| name | telegram-bot |
| description | Telegram bot integration for receiving messages and reactions. Use when setting up Telegram webhooks or managing Telegram bot configuration. |
Telegram Bot Skill
Telegram bot integration for receiving messages/reactions and spawning sidekicks.
Setup
1. Create Bot with BotFather
- Open Telegram, search for @BotFather
- Send
/newbot and follow prompts
- Copy the bot token (looks like
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
2. Get Your User ID
- Search for @userinfobot in Telegram
- Send any message - it replies with your user ID (a number like
YOUR_USER_ID)
3. Add to .env
TELEGRAM_BOT_TOKEN=your-bot-token-from-botfather
TELEGRAM_WEBHOOK_SECRET=any-random-secret-string-you-make-up
The TELEGRAM_WEBHOOK_SECRET can be anything - it's used to verify webhooks are from Telegram.
4. Configure Settings
echo "true" > recall/settings/telegram-bot/enabled.txt
echo "YOUR_USER_ID" > recall/settings/telegram-bot/users.txt
mkdir -p recall/settings/telegram-bot/webhooks
echo "true" > recall/settings/telegram-bot/webhooks/incoming-message.txt
5. Start Sidekick Server
clappie background start sidekicks
6. Expose via Tailscale Funnel
Telegram only allows ports 80, 88, 443, or 8443. Use Tailscale Funnel to proxy:
tailscale funnel 7777
This gives you a URL like https://your-machine.tail1234.ts.net
7. Set Webhook URL
Get your webhook path and set the webhook:
WEBHOOK_PATH=$(cat recall/settings/telegram-bot/webhook-path.txt)
curl -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/setWebhook" \
-d "url=https://your-machine.tail1234.ts.net/webhooks/telegram-bot/${WEBHOOK_PATH}" \
-d "secret_token=${TELEGRAM_WEBHOOK_SECRET}"
Critical: The secret_token parameter must match your TELEGRAM_WEBHOOK_SECRET env var, or signature verification will fail.
8. Verify Webhook
curl "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getWebhookInfo"
Should show your URL with pending_update_count: 0 and no errors.
Settings
All settings in recall/settings/telegram-bot/:
| File | Description | Required |
|---|
enabled.txt | Set to true to enable | Yes |
webhook-path.txt | Secret URL segment (auto-generated) | Auto |
users.txt | Allowed Telegram user IDs (one per line) | Yes |
webhooks/incoming-message.txt | Enable incoming messages | Yes |
sidekick-prompt.txt | Custom prompt/personality for sidekicks (overrides skill defaults) | No |
CLI Commands
clappie telegram send <chatId> <message>
clappie telegram photo <chatId> <path>
clappie telegram document <chatId> <path>
clappie telegram voice <chatId> <path>
clappie telegram video <chatId> <path>
clappie telegram sticker <chatId> <id>
clappie telegram react <chatId> <msgId> <emoji>
clappie telegram webhook <url>
clappie telegram webhook-info
clappie telegram me
Sidekick Extension Commands
When a Telegram sidekick is running, these extra commands are available (registered via sidekickCommands in webhooks/send.js). The sidekick ID is auto-detected from the CLAPPIE_SIDEKICK_ID env var -- no need to type it. Explicit ID still works as an override.
clappie sidekick react <msgId> 👍
clappie sidekick combo <msgId> 👍 🔥 🎉
clappie sidekick sticker <setName> [index]
clappie sidekick sticker <setName> random
clappie sidekick send-file photo "/path" "caption"
clappie sidekick send-file document "/path" "caption"
clappie sidekick send-file voice "/path"
clappie sidekick send-file video "/path" "caption"
These are only available to sidekicks with source: telegram-bot. Internal sidekicks or Slack sidekicks can't use them.
Reactions
When a user reacts to a message, the sidekick receives:
[Reacted with 👍]
Direct CLI (not sidekick):
clappie telegram react YOUR_USER_ID 123 👍
How It Works
- User sends message to bot
- Telegram POSTs to
/webhooks/telegram-bot/{webhook-path}
- Server verifies
X-Telegram-Bot-Api-Secret-Token header matches TELEGRAM_WEBHOOK_SECRET
- Handler parses message, downloads any attachments
- Sidekick spawns with message content
- Claude can reply via
clappie sidekick send, clappie sidekick react, etc.
Troubleshooting
"Invalid signature" errors
When setting webhook, you MUST include secret_token:
curl -X POST "https://api.telegram.org/bot.../setWebhook" \
-d "url=https://..." \
-d "secret_token=${TELEGRAM_WEBHOOK_SECRET}"
"Bad port" error from Telegram
Telegram only allows ports 80, 88, 443, 8443. Use Tailscale Funnel or another reverse proxy.
"Not found" when visiting webhook URL in browser
Normal - webhooks only accept POST requests.
Messages not received
- Is Tailscale Funnel running?
- Is sidekick server running? (
clappie background start sidekicks)
- Is user ID in
users.txt?
- Check
getWebhookInfo for errors
Bot doesn't respond
- Check sidekick logs:
tail -f recall/logs/sidekicks/*.txt
- Make sure
enabled.txt is true
Environment Variables
| Variable | Description |
|---|
TELEGRAM_BOT_TOKEN | Bot token from BotFather |
TELEGRAM_WEBHOOK_SECRET | Secret for webhook verification (you make this up) |