Telegram

Mudabbir supports Telegram via the python-telegram-bot library. It works as a standard Telegram bot with support for topics, inline keyboards, and streaming.

Setup

Create a bot

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts
  3. Copy the bot token

Configure

Terminal window
export MUDABBIR_TELEGRAM_TOKEN="your-bot-token"

Start

Terminal window
# Telegram-only mode
mudabbir --telegram
# Or via web dashboard (configure in Channels modal)
mudabbir

Configuration

SettingEnv VariableDescription
Bot tokenMUDABBIR_TELEGRAM_TOKENBot token from BotFather
Allowed user IDsMUDABBIR_ALLOWED_TELEGRAM_IDSComma-separated user IDs

Features

Streaming

Telegram supports edit-in-place streaming. The bot sends an initial message and then edits it as more tokens arrive, giving a real-time typing effect.

Topic Support

Mudabbir supports Telegram’s topic feature (available in groups with topics enabled). Each topic gets its own session:

  • Session key format: {chat_id}:topic:{topic_id}
  • Messages in different topics maintain separate conversation histories

Access Control

Restrict access by specifying allowed Telegram user IDs:

Terminal window
export MUDABBIR_ALLOWED_TELEGRAM_IDS="123456,789012"

Only users with these IDs can interact with the bot. If not set, anyone can use the bot.

Commands

The bot responds to direct messages and can be configured with custom commands via BotFather’s /setcommands.

Installation

Terminal window
curl -fsSL https://mudabbir.fly.dev/install.sh | sh
# Or add the Telegram extra manually
pip install mudabbir[telegram]

This installs python-telegram-bot as a dependency.