
MoltBot Telegram Bot - Complete Integration Tutorial
Set up MoltBot as a Telegram bot. Step-by-step configuration, commands, and advanced features guide.
Complete MoltBot Telegram Integration Guide
Telegram is one of the most popular ways to interact with MoltBot. This guide covers everything from basic setup to advanced features.
Why Telegram?
- Cross-Platform: Works on any device
- No Phone Number Sharing: Privacy-friendly
- Rich Features: Images, files, buttons, groups
- API-Friendly: Easy bot integration
- Fast: Real-time message delivery
Creating Your Telegram Bot
Step 1: Talk to BotFather
- Open Telegram and search for
@BotFather - Start a chat and send
/newbot - Follow the prompts:
- Choose a name (e.g., "My MoltBot")
- Choose a username (must end in
bot, e.g.,myMoltBot_bot)
Step 2: Get Your Token
BotFather will give you a token like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyzKeep this token secret!
Step 3: Configure MoltBot
# Set the token
export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
# Enable Telegram integration
moltbot config set telegram.enabled trueOr in ~/.moltbot/config.json:
{
"telegram": {
"enabled": true,
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
}
}Step 4: Start MoltBot
moltbot startNow you can chat with your bot on Telegram!
Bot Configuration
Basic Settings
{
"telegram": {
"enabled": true,
"token": "YOUR_TOKEN",
"allowedUsers": [],
"allowedGroups": [],
"adminUsers": []
}
}Access Control
Restrict who can use the bot:
{
"telegram": {
"allowedUsers": [123456789, 987654321],
"allowedGroups": [-1001234567890],
"adminUsers": [123456789]
}
}Find your user ID by messaging @userinfobot on Telegram.
Bot Commands
Set up command suggestions in BotFather:
/start - Start the bot
/help - Show help message
/memory - Manage memory
/settings - Bot settings
/cancel - Cancel current operationSend to BotFather:
/setcommandsFeatures
Text Chat
Simply send a message to your bot:
You: What's the weather like?
Bot: I don't have real-time weather data, but I can help you set up weather alerts...Image Analysis
Send an image with a question:
[Image attachment]
You: What's in this image?
Bot: This image shows...Document Processing
Send PDFs, text files, or code:
[document.pdf]
You: Summarize this document
Bot: Here's a summary of the key points...Voice Messages
Send voice messages for transcription:
[Voice message]
Bot: I heard: "Please remind me to call John at 3pm"Group Chat Integration
Adding to Groups
- Add your bot to a Telegram group
- Give it admin rights (or disable privacy mode)
Privacy Mode
By default, bots only see messages that:
- Start with
/ - Mention the bot
- Are replies to the bot
To see all messages, disable privacy mode in BotFather:
/setprivacyGroup Configuration
{
"telegram": {
"groups": {
"-1001234567890": {
"enabled": true,
"triggerOnMention": true,
"triggerOnReply": true,
"prefix": "!bot"
}
}
}
}Group Commands
In groups, users can:
@your_bot What's the capital of France?
/ask What time is it in Tokyo?
!bot Tell me a jokeInline Mode
Enable Inline Queries
In BotFather:
/setinlineEnter a placeholder like "Type a query..."
Using Inline Mode
In any chat, type:
@your_bot translate hello to SpanishInline Configuration
{
"telegram": {
"inline": {
"enabled": true,
"cacheTime": 300,
"isPersonal": true
}
}
}Notifications and Reminders
Setting Reminders
You: Remind me to call mom in 2 hours
Bot: Got it! I'll remind you to call mom at 5:30 PMDaily Summaries
{
"telegram": {
"notifications": {
"dailySummary": {
"enabled": true,
"time": "09:00"
}
}
}
}Webhooks vs Polling
Polling (Default)
Simple, works everywhere:
{
"telegram": {
"mode": "polling",
"pollingInterval": 1000
}
}Webhooks (Recommended for Production)
Faster, more efficient:
{
"telegram": {
"mode": "webhook",
"webhook": {
"url": "https://yourdomain.com/telegram/webhook",
"secret": "your-secret-token"
}
}
}Set up webhook:
moltbot telegram set-webhook https://yourdomain.com/telegram/webhookCustomization
Welcome Message
{
"telegram": {
"messages": {
"welcome": "Hello! I'm MoltBot, your AI assistant. How can I help you today?",
"help": "Here's what I can do:\\n- Answer questions\\n- Analyze images\\n- Set reminders\\n- And much more!"
}
}
}Custom Keyboards
{
"telegram": {
"keyboard": {
"persistent": true,
"buttons": [
["Help", "Settings"],
["My Tasks", "Reminders"]
]
}
}
}Typing Indicator
{
"telegram": {
"showTyping": true
}
}Rate Limiting
Protect against spam:
{
"telegram": {
"rateLimit": {
"messagesPerMinute": 20,
"burstLimit": 5
}
}
}Logging and Debugging
Enable Debug Logs
DEBUG=moltbot:telegram moltbot startView Telegram Updates
moltbot telegram logs --followTroubleshooting
Bot Not Responding
- Check token is correct
- Verify bot is running:
moltbot status - Check logs:
moltbot logs
"Forbidden: bot was blocked by the user"
The user blocked your bot. Can't send messages to them.
Webhook Errors
- Ensure HTTPS with valid certificate
- Check webhook URL is accessible
- Verify secret token matches
Rate Limit Errors
Telegram limits: 30 messages/second per bot, 20 messages/minute per chat.
{
"telegram": {
"rateLimit": {
"respectTelegramLimits": true
}
}
}Your MoltBot is now ready to chat on Telegram! Need help? Join our Discord community.
Categories
More Posts

MoltBot GitHub - Source Code, Installation & Contributing Guide
Official MoltBot GitHub repository. Clone, install from source, and contribute to the open source project. Complete guide to MoltBot GitHub.

MoltBot with Google Gemini - Setup & Configuration
Configure MoltBot to use Google Gemini AI. API setup, model selection, and optimization guide for Gemini integration.

How to Install MoltBot: Complete Setup Guide
Step-by-step guide to installing MoltBot on macOS, Windows, and Linux. Get your personal AI assistant up and running in minutes.
Newsletter
Join the community
Subscribe to our newsletter for the latest news and updates