LogoOpenClawAI
  • Features
  • Get Started
  • Blog
MoltBot Telegram Bot - Complete Integration Tutorial
2026/01/30

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

  1. Open Telegram and search for @BotFather
  2. Start a chat and send /newbot
  3. 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:ABCdefGHIjklMNOpqrsTUVwxyz

Keep this token secret!

Step 3: Configure MoltBot

# Set the token
export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"

# Enable Telegram integration
moltbot config set telegram.enabled true

Or in ~/.moltbot/config.json:

{
  "telegram": {
    "enabled": true,
    "token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
  }
}

Step 4: Start MoltBot

moltbot start

Now 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 operation

Send to BotFather:

/setcommands

Features

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

  1. Add your bot to a Telegram group
  2. 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:

/setprivacy

Group 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 joke

Inline Mode

Enable Inline Queries

In BotFather:

/setinline

Enter a placeholder like "Type a query..."

Using Inline Mode

In any chat, type:

@your_bot translate hello to Spanish

Inline 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 PM

Daily 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/webhook

Customization

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 start

View Telegram Updates

moltbot telegram logs --follow

Troubleshooting

Bot Not Responding

  1. Check token is correct
  2. Verify bot is running: moltbot status
  3. Check logs: moltbot logs

"Forbidden: bot was blocked by the user"

The user blocked your bot. Can't send messages to them.

Webhook Errors

  1. Ensure HTTPS with valid certificate
  2. Check webhook URL is accessible
  3. 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.

All Posts

Categories

    Complete MoltBot Telegram Integration GuideWhy Telegram?Creating Your Telegram BotStep 1: Talk to BotFatherStep 2: Get Your TokenStep 3: Configure MoltBotStep 4: Start MoltBotBot ConfigurationBasic SettingsAccess ControlBot CommandsFeaturesText ChatImage AnalysisDocument ProcessingVoice MessagesGroup Chat IntegrationAdding to GroupsPrivacy ModeGroup ConfigurationGroup CommandsInline ModeEnable Inline QueriesUsing Inline ModeInline ConfigurationNotifications and RemindersSetting RemindersDaily SummariesWebhooks vs PollingPolling (Default)Webhooks (Recommended for Production)CustomizationWelcome MessageCustom KeyboardsTyping IndicatorRate LimitingLogging and DebuggingEnable Debug LogsView Telegram UpdatesTroubleshootingBot Not Responding"Forbidden: bot was blocked by the user"Webhook ErrorsRate Limit Errors

    More Posts

    MoltBot GitHub - Source Code, Installation & Contributing Guide

    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.

    2026/01/30
    MoltBot with Google Gemini - Setup & Configuration

    MoltBot with Google Gemini - Setup & Configuration

    Configure MoltBot to use Google Gemini AI. API setup, model selection, and optimization guide for Gemini integration.

    2026/01/30
    How to Install MoltBot: Complete Setup Guide

    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.

    2026/01/30

    Newsletter

    Join the community

    Subscribe to our newsletter for the latest news and updates

    LogoOpenClawAI

    The AI that actually does things. Open-source personal AI assistant.

    GitHubGitHubEmail
    Product
    • Features
    • FAQ
    Resources
    • Blog
    Company
    • About
    • Contact
    Legal
    • Cookie Policy
    • Privacy Policy
    • Terms of Service
    Š 2026 OpenClawAI All Rights Reserved.