Discord Setup
Connect your CCCC working group to Discord for community access.
Overview
Discord integration is great for:
- Developer communities
- Open source projects
- Gaming and hobby groups
- Public collaboration
Prerequisites
- A Discord server where you have admin rights
- CCCC installed and running
Step 1: Create a Discord Application
- Go to Discord Developer Portal
- Click New Application
- Enter a name (e.g., "CCCC Bot")
- Accept the terms and click Create
Step 2: Create a Bot
- In your application, go to Bot in the sidebar
- Click Add Bot
- Confirm by clicking Yes, do it!
Configure Bot Settings
Under the Bot section:
| Setting | Recommended |
|---|---|
| Public Bot | OFF (unless you want others to add it) |
| Requires OAuth2 Code Grant | OFF |
| Presence Intent | OFF |
| Server Members Intent | OFF |
| Message Content Intent | ON (required!) |
Important
Message Content Intent must be enabled, or the bot cannot read messages.
Step 3: Get Bot Token
- In the Bot section, click Reset Token
- Confirm and copy the new token
- Save this token securely
Security
Never share your bot token. If exposed, regenerate it immediately.
Step 4: Set Bot Permissions
Go to OAuth2 → URL Generator
Under Scopes, select:
botapplications.commands(optional, for slash commands)
Under Bot Permissions, select:
| Permission | Purpose |
|---|---|
| Read Messages/View Channels | See channels and messages |
| Send Messages | Reply to users |
| Send Messages in Threads | Reply in threads |
| Embed Links | Rich message formatting |
| Attach Files | Share files |
| Read Message History | Access conversation history |
| Add Reactions | React to messages |
- Copy the generated URL at the bottom
Step 5: Add Bot to Server
- Open the URL from Step 4 in your browser
- Select your server from the dropdown
- Click Continue
- Review permissions and click Authorize
- Complete the CAPTCHA
Step 6: Set Environment Variable
# Add to your shell profile
export DISCORD_BOT_TOKEN="your-bot-token-here"Step 7: Configure CCCC
Option A: Via Web UI
- Open the CCCC Web UI at
http://127.0.0.1:8848/ - Go to Settings (gear icon in header)
- Navigate to the IM Bridge section
- Select Discord as the platform
- Enter your credentials:
- Token Environment Variable:
DISCORD_BOT_TOKEN
- Token Environment Variable:
- Click Save
Option B: Via CLI
cccc im set discord --token-env DISCORD_BOT_TOKENBoth methods save to group.yaml:
im:
platform: discord
token_env: DISCORD_BOT_TOKENStep 8: Start the Bridge
cccc im startStep 9: Subscribe in Discord
- Go to a channel where the bot has access
- Send
/subscribe - You should receive a confirmation
Usage
Sending Messages to Agents
In channels, @mention the bot for ordinary text:
@YourBotName /send Please review the latest pull requestRecognized CCCC commands such as /send, /status, and /subscribe may be sent without an @mention. Unrelated slash commands remain ignored:
/send Please review the latest pull requestIn direct messages with the bot, you can use /send directly:
/send Please review the latest pull requestImportant
- In channels, ordinary text and files require @mention; recognized CCCC slash commands do not
- After mentioning the bot, plain text is treated as implicit send to foreman
- Use
/sendwhen you need explicit recipients like@allor@peers
Targeting Specific Agents
Use @mention syntax with the /send command:
/send @foreman Coordinate the release
/send @tester Run the integration tests
/send @all Status update pleaseReceiving Messages
After subscribing, you will automatically receive:
- Agent responses
- Status updates
- Error notifications
Use /verbose (or /verbose on) to receive agent-to-agent messages, and /verbose off to stop receiving them.
Agent output is updated progressively by editing the initial Discord message. Completed replies longer than Discord's single-message limit are delivered in lossless 2,000-character chunks.
Thread Support
Create threads for focused discussions. Discord threads are channels, so CCCC naturally authorizes and replies to the specific thread channel.
File Attachments
Attach files to your message. They're stored in CCCC's blob storage, then forwarded to agents.
Embeds
CCCC formats responses with Discord embeds for better readability when appropriate.
Commands Reference
| Command | Description |
|---|---|
/subscribe | Start receiving messages from CCCC |
/unsubscribe | Stop receiving messages |
/send <message> | Send to foreman (default) |
/send @<actor> <message> | Send to a specific agent |
/send @all <message> | Send to all agents |
/send @peers <message> | Send to non-foreman agents |
/status | Show group and agent status |
/pause | Pause delivery for this channel or thread |
/resume | Resume delivery for this channel or thread |
/verbose [on|off] | Enable verbose delivery, or disable it with off |
/help | Show available commands |
Slash Commands (Optional)
Register application commands for better UX:
- Go to your app in Developer Portal
- Navigate to Bot → Interactions Endpoint URL
- Or use the Discord API to register commands
Example slash command structure:
/cccc send <message>
/cccc status
/cccc agentsTroubleshooting
"Missing Access" Error
The bot lacks permissions:
- Check the bot's role in Server Settings
- Ensure the role has necessary permissions
- Verify channel-specific permissions
"Missing Intent" Error
Enable Message Content Intent:
- Go to Developer Portal → Your App → Bot
- Enable Message Content Intent
- Save changes
- Restart the bridge
"Gateway READY timed out" Error
The Discord Gateway uses a WebSocket connection. If Discord is only reachable through a proxy, set the proxy before starting CCCC. The Rust implementation supports HTTP CONNECT and SOCKS5 proxy URLs and respects NO_PROXY.
macOS/Linux:
export HTTPS_PROXY="http://127.0.0.1:7890"
cccc im stop
cccc im startWindows PowerShell:
$env:HTTPS_PROXY = "http://127.0.0.1:7890"
[Environment]::SetEnvironmentVariable("HTTPS_PROXY", $env:HTTPS_PROXY, "User")
cccc im stop
cccc im startUse a socks5:// URL instead when connecting through a SOCKS5 proxy. Restart the CCCC process after changing a persistent environment variable. If the error instead names MESSAGE_CONTENT, enable Message Content Intent in the Developer Portal.
Bot is offline
Check the bridge is running:
bashcccc im statusVerify the token:
bashcccc im logs -fRegenerate token if needed
Rate limiting
Discord has strict rate limits:
- Reduce message frequency
- Use
/verbose offto minimize traffic - Consider batching updates
Advanced Configuration
Specific Channels
Limit the bot to certain channels:
im:
platform: discord
token_env: DISCORD_BOT_TOKEN
allowed_channels:
- 123456789012345678 # Channel IDGet channel ID: Enable Developer Mode in Discord settings, right-click channel → Copy ID.
Activity Status
Set the bot's status message:
im:
platform: discord
token_env: DISCORD_BOT_TOKEN
activity:
type: watching # playing, streaming, listening, watching
name: "for commands"Multiple Servers
One bot can serve multiple servers. Each server needs to:
- Add the bot via OAuth URL
- Subscribe in desired channels
Security Notes
- Keep the bot token secret
- Limit bot permissions to what's needed
- Use channel permissions to restrict access
- Review server roles regularly
- Consider verification levels for your server
- Be cautious with public bots - they can be added by anyone