ClawdBot + Telegram Integration

Connect your personal AI assistant to Telegram in under 10 minutes.

💬 Why Telegram is the Best Platform for ClawdBot

Telegram is the most popular choice for ClawdBot users. Here's why:

Easy Setup

Official Bot API with simple token-based authentication. No QR codes or phone linking required.

🔒

Reliable

Telegram's Bot API is stable and well-documented. Rarely breaks unlike WhatsApp integrations.

🌍

Cross-Platform

Access your AI from phone, desktop, web, or tablet. All devices stay in sync.

📁

File Sharing

Send files up to 2GB to your AI. Perfect for document analysis and image processing.

👥

Group Support

Add your bot to group chats. Multiple users can interact with the same AI instance.

Fast

Telegram's infrastructure is blazing fast. Messages arrive instantly.

📋 Prerequisites

Before starting, make sure you have:

  • ✅ ClawdBot installed and working (see Installation Guide)
  • ✅ A Telegram account
  • ✅ Telegram app installed on your phone or computer
  • ✅ 10 minutes of time

🤖 Step 1: Create Your Telegram Bot

1.1 Open BotFather

BotFather is Telegram's official bot for creating and managing bots.

  • Open Telegram
  • Search for @BotFather
  • Start a chat with BotFather

1.2 Create New Bot

Send the following command to BotFather:

/newbot

1.3 Choose Bot Name

BotFather will ask for two things:

  1. Display Name: This is what users see (e.g., "My Personal AI")
  2. Username: Must end in "bot" (e.g., "mypersonal_ai_bot")

Example conversation:

You: /newbot
BotFather: Alright, a new bot. How are we going to call it?
You: My ClawdBot Assistant
BotFather: Good. Now let's choose a username for your bot.
You: myclawdbot_assistant_bot
BotFather: Done! Congratulations on your new bot.

1.4 Save Your Bot Token

BotFather will give you a token that looks like this:

6234567890:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw

⚠️ IMPORTANT: Keep this token secret! Anyone with this token can control your bot.

1.5 Configure Bot Settings (Optional)

Recommended settings for better UX:

# Set bot description
/setdescription
# Then select your bot and enter:
"Your personal AI assistant powered by ClawdBot"

# Set profile picture
/setuserpic
# Upload an image

# Disable group privacy (allows bot to read all messages in groups)
/setprivacy
# Select your bot, then choose "Disable"

⚙️ Step 2: Configure ClawdBot

Method 1: Using the Setup Wizard (Easiest)

# Run ClawdBot setup wizard
clawdbot setup --wizard

# When prompted:
# 1. Select "Add new channel"
# 2. Choose "Telegram"
# 3. Enter your bot token
# 4. Give it a name (e.g., "telegram-main")

Method 2: Manual Configuration

Edit your ClawdBot configuration file:

# Open config file
nano ~/.clawdbot/config.yaml

Add this section:

channels:
  telegram-main:
    type: telegram
    token: "YOUR_BOT_TOKEN_HERE"
    enabled: true
    # Optional settings:
    allowedUsers:  # Restrict to specific Telegram user IDs
      - 123456789
      - 987654321
    # Or leave empty to allow anyone

Save and exit (Ctrl+X, then Y, then Enter).

Finding Your Telegram User ID

To restrict access to only yourself:

  1. Message @userinfobot on Telegram
  2. It will reply with your user ID
  3. Add this ID to allowedUsers in config

✅ Step 3: Start Gateway and Test

3.1 Start ClawdBot Gateway

# Start the Gateway
clawdbot gateway start

# Or restart if already running
clawdbot gateway restart

3.2 Check Logs

Verify Telegram channel connected successfully:

# View logs
clawdbot gateway logs

# Look for:
# ✓ Telegram channel 'telegram-main' connected

3.3 Send Test Message

  1. Open Telegram
  2. Find your bot (search for the username you created)
  3. Start a chat with /start
  4. Send a message: Hello! Who are you?

Your ClawdBot should respond within 1-3 seconds!

Troubleshooting Connection Issues

If bot doesn't respond:

# Check Gateway status
clawdbot gateway status

# Verify token is correct
cat ~/.clawdbot/config.yaml | grep token

# Check firewall isn't blocking Telegram API
curl https://api.telegram.org/bot<YOUR_TOKEN>/getMe

🚀 Advanced Features

Using Bot in Group Chats

  1. Add your bot to a Telegram group
  2. Make it an admin (or disable privacy mode in BotFather)
  3. Mention the bot: @yourbotname what's the weather?

Inline Mode

Enable inline queries to use your AI in any chat:

# In BotFather
/setinline
# Select your bot
# Set placeholder text: "Ask your AI..."

# Now in any chat, type:
@yourbotname what is ClawdBot?

Custom Commands

Set up command menu for your bot:

# In BotFather
/setcommands
# Select your bot
# Enter commands:
start - Start conversation
help - Show help
reset - Clear conversation history
status - Check bot status

File Uploads

Your bot can receive and process files:

  • 📄 Documents (PDF, DOCX, TXT)
  • 🖼️ Images (for vision models like GPT-4V)
  • 🎵 Audio (for transcription)

Just send a file to your bot - ClawdBot will automatically process it!

Voice Messages

If you have speech-to-text configured:

# Install Whisper skill
clawdbot skills install whisper

# Now send voice messages to your bot
# They'll be transcribed and processed

🔧 Troubleshooting Common Issues

Bot doesn't respond

Possible causes:

  • ❌ Gateway not running: clawdbot gateway start
  • ❌ Wrong token: Double-check token in config
  • ❌ No AI model configured: Add API key in clawdbot setup
  • ❌ User not in allowedUsers list: Remove restriction or add your ID

"Unauthorized" error in logs

Solution: Your bot token is invalid or revoked.

# Get new token from BotFather
/token
# Select your bot
# Copy new token and update config

Bot responds slowly

Possible causes:

  • Slow AI model (switch to faster model)
  • Network latency to AI provider
  • Server overloaded (check CPU/RAM usage)

Bot stops working after some time

Solution: Set up auto-restart:

# Use systemd or LaunchAgent
# See: clawdbot-mac-mini.html for auto-start guide

💡 Pro Tips

1. Use Multiple Bots for Different Purposes

channels:
  telegram-personal:
    type: telegram
    token: "TOKEN_1"
    model: claude-3-5-sonnet  # Smart model
  
  telegram-quick:
    type: telegram
    token: "TOKEN_2"
    model: gemini-flash  # Fast, cheap model

2. Set Up Notifications

Make your AI proactively message you:

# Example: Daily briefing at 8 AM
# Use ClawdBot's scheduler skill
clawdbot skills install scheduler

3. Privacy Best Practices

  • ✅ Always use allowedUsers to restrict access
  • ✅ Don't share your bot username publicly
  • ✅ Revoke and regenerate token if compromised
  • ✅ Use Telegram's "Secret Chat" feature for sensitive conversations

4. Combine with Other Channels

You can run Telegram + Discord + WhatsApp simultaneously!

🎯 Next Steps

Now that Telegram is connected: