Documentation Index
Fetch the complete documentation index at: https://docs.cowagent.ai/llms.txt
Use this file to discover all available pages before exploring further.
Integrate CowAgent into Discord via a Discord Bot using the Gateway (persistent WebSocket). Supports direct messages (DM) and server channels (triggered by @mention or replying to the bot). The Gateway uses a persistent WebSocket connection — no public IP or callback URL required, works out of the box.
1. Setup
Step 1: Create a Discord Application and Bot
- Open the Discord Developer Portal, click New Application, enter a name (e.g.
CowAgent), and create it. - Go to the Bot page in the left sidebar, click Reset Token to generate a Bot Token, then copy and store it safely (shown only once).
Step 2: Enable the Message Content Intent
Reading message text in both DMs and channels depends on this privileged intent.- On the Bot page, find Privileged Gateway Intents.
- Turn on Message Content Intent and save.
Without this intent enabled, incoming message content will be empty and the bot will not respond.
Step 3: Invite the Bot to a Server
- Go to OAuth2 → URL Generator in the left sidebar.
- Under Scopes, check
bot. - Under Bot Permissions, check at least:
Send Messages,Read Message History,Attach Files,View Channels. - Copy the generated authorization URL at the bottom, open it in a browser, and authorize it for your target server.
You can skip this step if you only need DMs, but you still need a DM channel with the bot (e.g. the user messages the bot directly).
Step 4: Connect to CowAgent
- Web Console (Recommended)
- Config File
Open the Web Console (default
http://127.0.0.1:9899), go to Channels, click Add Channel, choose Discord, paste the Bot Token, and click connect.2. Capabilities
| Feature | Support |
|---|---|
| Direct message (DM) | ✅ |
| Server channel (@bot / reply to bot) | ✅ |
| Text messages | ✅ send / receive |
| Image messages | ✅ send / receive |
| File messages | ✅ send / receive (PDF / Word / Excel, etc.) |
A single Discord message is capped at 2000 characters; long replies are automatically split across multiple messages by line breaks.
3. Usage
Once connected:- Direct message (DM): find your bot in the server member list, click its avatar, and message it directly.
- Channel: in a channel where the bot is invited, trigger it with
@your-bot helloor by replying to one of the bot’s messages.
