Add an AI Assistant to Your Discord Server
Discord bots are everywhere, but most are wrappers around a single API call. No memory, no tools, no ability to actually do things. PocketPaw gives your Discord server a proper AI agent that can search the web, analyze files, generate images, and remember conversations.
This guide gets a PocketPaw-powered Discord bot running in your server.
What You’ll Build
/pawslash command for interacting with the AI- DM support for private conversations
- @mention support in channels
- Streaming responses (edits in real-time as the AI thinks)
- Persistent memory across conversations
- Access to 50+ tools (web search, image gen, file handling, and more)
Prerequisites
- PocketPaw installed (follow the installation guide)
- A Discord account with permission to add bots to a server
- An AI provider: Anthropic API key or Ollama
Setting Up the Bot
Create a Discord Application
- Go to the Discord Developer Portal
- Click “New Application” and give it a name
- Go to the Bot section in the sidebar
- Click “Reset Token” and copy the bot token
Under Privileged Gateway Intents, enable:
- Message Content Intent (required for reading messages)
Invite the bot to your server
- Go to OAuth2 > URL Generator
- Select scopes:
bot,applications.commands - Select permissions:
Send Messages,Read Message History,Use Slash Commands,Embed Links,Attach Files - Copy the generated URL and open it in your browser
- Select your server and authorize
Install the Discord extra
pip install pocketpaw[discord]Configure environment variables
export POCKETPAW_DISCORD_BOT_TOKEN="your-bot-token"export POCKETPAW_ANTHROPIC_API_KEY="sk-ant-..." # or use Ollama
# Optional: restrict to specific servers and usersexport POCKETPAW_DISCORD_ALLOWED_GUILD_IDS="111222333444"export POCKETPAW_DISCORD_ALLOWED_USER_IDS="555666777888"Start PocketPaw
pocketpawThe web dashboard starts at localhost:8888, and your Discord bot comes online automatically. You can also run headless:
pocketpaw --discordTest in Discord
- Type
/paw what can you do?in any channel - DM the bot directly for private conversations
- @mention the bot in a channel message
The bot streams its response in real-time, editing the message as new text arrives.
How Streaming Works
Discord has rate limits on message edits (roughly one edit per 1.5 seconds). PocketPaw buffers chunks and updates the message at safe intervals, so responses appear smoothly without hitting rate limits.
Access Control
Control who can use the bot and where:
# Only specific serversexport POCKETPAW_DISCORD_ALLOWED_GUILD_IDS="111222333,444555666"
# Only specific usersexport POCKETPAW_DISCORD_ALLOWED_USER_IDS="123456789,987654321"Without these restrictions, anyone in the server can use the bot. For public communities, setting allowed user IDs is strongly recommended.
Conversation Mode
Let the bot participate naturally in group channels without requiring /paw or @mentions.
Per-channel: Use the /converse slash command in any channel (requires Administrator or Manage Server permission). The bot tracks the last 30 messages and decides when to respond based on context. It stays silent when the conversation isn’t directed at it. Toggle it off the same way, run /converse again.
Server-wide: Enable conversation mode across all channels at once:
export POCKETPAW_DISCORD_CONVERSATION_ALL_CHANNELS=true
# Exclude channels that shouldn't have it (announcements, rules, etc.)export POCKETPAW_DISCORD_CONVERSATION_EXCLUDE_CHANNEL_IDS="123456789,987654321"Server Management
The bot can manage your Discord server directly: send messages to channels, create threads, run polls, assign roles, and more. These capabilities are exposed via an MCP server that auto-registers on startup, so they work with any agent backend (Claude, Codex, Gemini, etc.).
The bot keeps its internal tool details hidden from users. When someone asks it to create a poll, it just does it and confirms naturally.
Running Multiple Channels
PocketPaw handles multiple channels from a single instance. Add Telegram alongside Discord:
pip install pocketpaw[telegram,discord]export POCKETPAW_TELEGRAM_BOT_TOKEN="your-telegram-token"export POCKETPAW_DISCORD_BOT_TOKEN="your-discord-token"pocketpawBoth bots share the same agent, tools, and memory system. A conversation started on Discord can be continued on Telegram (through the shared memory).
Docker Deployment
Prefer containers? A dedicated Discord Docker setup is available with multi-stage builds, Claude Code OAuth support, and Coolify-compatible configuration:
cd deploy/discordcp .env.example .env# Edit .env with your bot token and LLM providerdocker compose up -dSee the full Discord Docker Deployment guide for all LLM provider options and volume configuration.
Next Steps
Discord Channel Docs
Full reference for Discord-specific features, events, and configuration.
Discord Docker Deployment
Run the Discord bot in Docker with Claude Code OAuth and Coolify support.
Add Telegram
Give your agent mobile access through Telegram.
Self-Hosting Guide
Run your bot 24/7 on a home server or VPS.