Telegram Bot Skill
Enable Moltbot to send and receive messages through Telegram.
Telegram Bot
Connect your Moltbot agent to Telegram for conversational AI interactions.
What It Does
- Receive messages from Telegram users
- Send text responses
- Send images and files
- React to inline commands
- Handle group conversations
Install / Enable
The Telegram skill is built-in. Enable it by configuring your environment:
# .env
TELEGRAM_BOT_TOKEN=your-bot-token-from-botfather
TELEGRAM_WEBHOOK_URL=https://your-domain.com/api/telegram/webhookThen restart Moltbot:
docker-compose restartPermissions Required
| Permission | Required | Description |
|---|---|---|
| Read Messages | Yes | To receive user messages |
| Send Messages | Yes | To respond to users |
| Send Media | Optional | To send images/files |
| Group Access | Optional | For group conversations |
Example Commands
User: /start
Agent: Welcome! I'm your AI assistant. How can I help?
User: What's the weather like?
Agent: I'll check that for you... [uses web search skill]
User: /help
Agent: Here are the commands I understand:
/start - Start conversation
/help - Show this message
/reset - Clear conversation historyConfiguration
| Variable | Required | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN | Yes | Bot token from @BotFather |
TELEGRAM_WEBHOOK_URL | Yes | Your public HTTPS webhook URL |
TELEGRAM_ALLOWED_USERS | No | Comma-separated user IDs |
TELEGRAM_ADMIN_USERS | No | User IDs with admin access |
Restricting Access
To limit who can use your bot:
# Only allow specific users
TELEGRAM_ALLOWED_USERS=123456789,987654321
# Grant admin privileges to some users
TELEGRAM_ADMIN_USERS=123456789Risks
Privacy: Messages are processed by your AI provider. Don't share sensitive information.
Costs: Each message uses AI API credits. Set spending limits on your AI provider account.
Abuse: Public bots can be spammed. Use TELEGRAM_ALLOWED_USERS to restrict access.
Troubleshooting
Bot doesn't respond
- Check webhook is set: Telegram Bot No Response
- Verify HTTPS certificate is valid
- Check Moltbot logs for errors
Messages delayed
- Check
getWebhookInfofor pending update count - Your server might be slow to respond
- AI provider might have high latency
Bot works in DM but not groups
- Enable group privacy mode in @BotFather
- Or make the bot an admin in the group
Alternatives
- Discord Bot - For Discord communities
- Slack Bot - For team communication