Discord

PocketPaw integrates with Discord via discord.py. It supports slash commands, direct messages, and @mention in channels.

Setup

Create a Discord application

  1. Go to the Discord Developer Portal
  2. Click “New Application” and name it
  3. Go to the “Bot” section and create a bot
  4. Copy the bot token

Set permissions

Under OAuth2 → URL Generator, select:

  • Scopes: bot, applications.commands
  • Permissions: Send Messages, Read Message History, Use Slash Commands

Invite to server

Use the generated URL to invite the bot to your Discord server.

Configure

Terminal window
export POCKETCLAW_DISCORD_BOT_TOKEN="your-discord-token"

Start

Terminal window
pocketpaw --discord

Configuration

SettingEnv VariableDescription
Bot tokenPOCKETCLAW_DISCORD_BOT_TOKENDiscord bot token
Allowed guildsPOCKETCLAW_DISCORD_ALLOWED_GUILD_IDSComma-separated guild IDs
Allowed usersPOCKETCLAW_DISCORD_ALLOWED_USER_IDSComma-separated user IDs

Features

Slash Command

The bot registers a /paw slash command. Users can interact with:

/paw What files are in the home directory?

DM and Mention Support

  • Direct messages — Send a DM to the bot for private conversations
  • @mention — Mention the bot in any channel where it’s present

Streaming

Discord supports edit-in-place streaming with a 1.5-second rate limit. The bot sends an initial message and edits it as tokens arrive, batching updates to respect Discord’s rate limits.

Access Control

Terminal window
# Restrict to specific servers
export POCKETCLAW_DISCORD_ALLOWED_GUILD_IDS="111222333,444555666"
# Restrict to specific users
export POCKETCLAW_DISCORD_ALLOWED_USER_IDS="777888999"

Installation

Terminal window
curl -fsSL https://pocketpaw.xyz/install.sh | sh
# Or add the Discord extra manually
pip install pocketpaw[discord]

This installs discord.py as an optional dependency.