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 first, then use the /send command:
@YourBotName /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, you must @mention the bot before using commands
- Plain messages without the
/sendcommand are ignored
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 to toggle whether you see agent-to-agent messages.
Thread Support
Create threads for focused discussions. CCCC tracks thread context.
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 message delivery |
/resume | Resume message delivery |
/verbose | Toggle verbose mode (see all agent messages) |
/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
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