Back to docs

Telegram bot starter

Ship a licensed Telegram bot with python-telegram-bot and the Meridian client in under five minutes.

Stack

  • python-telegram-bot v21+ for async handlers
  • meridian-client pip package for license validation
  • SQLite for local session cache

Quickstart

pip install python-telegram-bot meridian-client

export MERIDIAN_LICENSE_KEY="mk_live_..."
export TELEGRAM_BOT_TOKEN="123:abc"

python bot.py

Minimal bot.py

from telegram.ext import Application, CommandHandler
from meridian import License

license = License()
license.validate()

async def start(update, context):
    await update.message.reply_text("Licensed bot online.")

app = Application.builder().token("...").build()
app.add_handler(CommandHandler("start", start))
app.run_polling()

Full source and Dockerfile available on the examples page.