Skip to content

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

  1. Open Telegram and search for @BotFather
  2. Start a chat and send /newbot
  3. Follow the prompts:
    • Choose a display name (e.g., "My CCCC Bot")
    • Choose a username (must end in bot, e.g., my_cccc_bot)
  4. BotFather will give you a token like:
    123456789:ABCdefGHIjklMNOpqrsTUVwxyz
  5. Save this token — you'll need it in the next step

Recommended: Disable Group Privacy

If you plan to use the bot in group chats, disable group privacy so the bot can see all messages:

  1. Send /mybots to BotFather
  2. Select your bot → Bot SettingsGroup Privacy
  3. Set to Disabled

Step 2: Configure CCCC

  1. Open the CCCC Web UI at http://127.0.0.1:8848/
  2. Go to Settings (gear icon in header)
  3. Navigate to the IM Bridge tab
  4. Select Telegram as the platform
  5. Enter your bot token:
    • Paste the token directly (e.g., 123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
    • Or enter an environment variable name (e.g., TELEGRAM_BOT_TOKEN)
  6. Click Save Config

CCCC IM Bridge Configuration

Security Best Practice

For production use, store the token in an environment variable instead of pasting it directly:

bash
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export TELEGRAM_BOT_TOKEN="your-token-here"

Then enter TELEGRAM_BOT_TOKEN in the Web UI. Never commit tokens to git.

Option B: Via CLI

bash
# Using environment variable name
cccc im set telegram --token-env TELEGRAM_BOT_TOKEN

# Verify configuration
cccc im config

Both methods save the configuration to your group's group.yaml:

yaml
im:
  platform: telegram
  token_env: TELEGRAM_BOT_TOKEN

Step 3: Start Bridge & Subscribe

Start the Bridge

Via Web UI: Click Save Config — the bridge starts automatically and shows Running status.

Via CLI:

bash
cccc im start

Verify it's running:

bash
cccc im status

Subscribe in Telegram

  1. Open Telegram and find your bot (search by username)
  2. Start a chat with the bot
  3. Send /subscribe
  4. You should receive a confirmation message

For group chats:

  1. Add the bot to your group
  2. Send /subscribe in the group
  3. All subscribed chats receive messages from CCCC

Usage

Sending Messages to Agents

Telegram supports two ways to send messages:

In group chats — @mention the bot and type your message directly:

@YourBotName Please implement the login feature

Or use the explicit /send command:

@YourBotName /send @all Status update please

In direct messages — just type your message:

Please implement the login feature

Implicit Send

When you @mention the bot (in groups) or send a direct message, plain text is automatically treated as /send to the foreman. You only need the explicit /send command when targeting specific agents like @all or @peers.

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 please

Receiving 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

CommandDescription
/subscribeStart receiving messages from CCCC
/unsubscribeStop 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
/statusShow group and agent status
/pausePause message delivery
/resumeResume message delivery
/verboseToggle verbose mode (see all agent messages)
/helpShow available commands

Troubleshooting

Bot not responding

  1. Check if the bridge is running:

    bash
    cccc im status
  2. Check logs for errors:

    bash
    cccc im logs -f
  3. Verify token is correct — re-check with BotFather (/mybots → select bot → API Token)

"Unauthorized" error

Your token is invalid. Get a new one from BotFather:

  1. Send /mybots to BotFather
  2. Select your bot
  3. Click API TokenRevoke current token
  4. Update your token in CCCC Settings (Web UI) or environment variable

Messages not delivered

  1. Ensure you've sent /subscribe
  2. Check that the CCCC daemon is running
  3. Verify the bridge status in Web UI or via cccc im status

Rate limiting

Telegram has rate limits. If you're sending many messages:

  • Messages may be delayed
  • Consider using /verbose to disable verbose mode and reduce traffic

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

Released under the Apache-2.0 License.