Telegram Setup
Connect your CCCC working group to Telegram for mobile access.
Overview
Telegram is the easiest platform to set up. It's ideal for:
- Personal use
- Quick prototyping
- Individual developers
Prerequisites
- A Telegram account
- CCCC installed and running
Step 1: Create a Bot
- Open Telegram and search for
@BotFather - Start a chat and send
/newbot - Follow the prompts:
- Choose a display name (e.g., "My CCCC Bot")
- Choose a username (must end in
bot, e.g.,my_cccc_bot)
- BotFather will give you a token like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz - Save this token securely - it's your bot's password
Step 2: Configure Bot Settings (Optional)
Still in BotFather, you can customize your bot:
/setdescription - Set bot description
/setabouttext - Set about text
/setuserpic - Set profile pictureRecommended Settings
Disable group privacy to allow the bot to see all messages in groups:
- Send
/mybotsto BotFather - Select your bot
- Go to Bot Settings → Group Privacy
- Set to Disabled
Step 3: Set Environment Variable
Store the token in an environment variable:
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
# Or set it for the current session
export TELEGRAM_BOT_TOKEN="your-token-here"Security
Never commit tokens to git. Use environment variables or a secrets manager.
Step 4: 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 Telegram as the platform
- Enter your credentials:
- Token Environment Variable:
TELEGRAM_BOT_TOKEN
- Token Environment Variable:
- Click Save
Option B: Via CLI
cccc im set telegram --token-env TELEGRAM_BOT_TOKENBoth methods save the configuration to your group's group.yaml:
im:
platform: telegram
token_env: TELEGRAM_BOT_TOKENStep 5: Start the Bridge
cccc im startVerify it's running:
cccc im statusStep 6: Subscribe in Telegram
- Open Telegram and find your bot (search by username)
- Start a chat with the bot
- Send
/subscribe - You should receive a confirmation message
For group chats:
- Add the bot to your group
- Send
/subscribein the group - All subscribed chats receive messages from CCCC
Usage
Sending Messages to Agents
In group chats, @mention the bot first, then use the /send command:
@YourBotName /send Please implement the login featureIn direct messages with the bot, you can use /send directly:
/send Please implement the login featureImportant
- In group chats, 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 Please review the PR
/send @peer-1 Run the 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.
File Attachments
Attach files to your message. They're downloaded and stored in CCCC's blob storage, then forwarded to agents.
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 |
Troubleshooting
Bot not responding
Check if the bridge is running:
bashcccc im statusCheck logs for errors:
bashcccc im logs -fVerify token is correct:
bashecho $TELEGRAM_BOT_TOKEN
"Unauthorized" error
Your token is invalid. Get a new one from BotFather:
- Send
/mybotsto BotFather - Select your bot
- Click API Token → Revoke current token
- Update your environment variable
Messages not delivered
- Ensure you've sent
/subscribe - Check that the daemon is running:
cccc daemon status - Verify the group is correct:
cccc group info
Rate limiting
Telegram has rate limits. If you're sending many messages:
- Messages may be delayed
- Consider using
/verbose offto reduce traffic
Advanced Configuration
Multiple Groups
Each working group can have its own Telegram bot:
# Switch to group 1
cccc use group-1
cccc im set telegram --token-env TELEGRAM_BOT_TOKEN_1
# Switch to group 2
cccc use group-2
cccc im set telegram --token-env TELEGRAM_BOT_TOKEN_2Webhook Mode (Advanced)
By default, CCCC uses long polling. For production, you can use webhooks:
# group.yaml
im:
platform: telegram
token_env: TELEGRAM_BOT_TOKEN
webhook_url: https://your-domain.com/telegram/webhookThis requires exposing an HTTPS endpoint.
Security Notes
- Keep your bot token secret
- Consider enabling 2FA on your Telegram account
- Review who has access to chats where the bot is subscribed
- The bot can see all messages in groups where it's added