Short answer
- Python: python-telegram-bot for batteries-included helpers and docs; aiogram if you like routers, middlewares and aiohttp.
- TypeScript / JavaScript: grammY. It is actively maintained, follows new Bot API versions quickly and runs on Node.js, Deno and serverless platforms such as Cloudflare Workers.
- Telegraf still works for existing projects, but its last npm release is from February 2024, so new projects are better served by grammY.
Comparison
| Library | Language | Latest version | License | Notes |
|---|---|---|---|---|
| python-telegram-bot | Python 3.10+ | 22.8 (June 2026) | LGPL-3.0 | ConversationHandler, JobQueue, persistence, built-in webhook server |
| aiogram | Python 3.10+ | 3.31.0 (Aug 2026), Bot API 10.3 | MIT | Routers, middlewares, finite state machine, aiohttp |
| grammY | TypeScript / JS | 1.46.0 (Aug 2026), Bot API 10.3 | MIT | Node.js, Deno, serverless adapters, large plugin set |
| Telegraf | TypeScript / JS | 4.16.3 (Feb 2024) | MIT | Mature API; v5 has been in development for a long time |
Versions and licenses checked on 2026-10-22 on PyPI, npm and the projects' GitHub pages. Check the changelog before upgrading.
The same bot in each
# python-telegram-bot
from telegram.ext import Application, CommandHandler
async def start(update, context):
await update.message.reply_text("Hi")
app = Application.builder().token(TOKEN).build()
app.add_handler(CommandHandler("start", start))
app.run_polling()
# aiogram 3
import asyncio
from aiogram import Bot, Dispatcher
from aiogram.filters import CommandStart
dp = Dispatcher()
@dp.message(CommandStart())
async def start(message):
await message.answer("Hi")
asyncio.run(dp.start_polling(Bot(TOKEN)))
// grammY
import { Bot } from "grammy";
const bot = new Bot(TOKEN);
bot.command("start", (ctx) => ctx.reply("Hi"));
bot.start();
How to choose
- Use the language your team already knows; the Bot API is the same underneath.
- Serverless webhook on Workers or Deno Deploy: grammY.
- Multi-step forms and reminders in Python with little code: python-telegram-bot.
- Larger Python codebase with modular routers and middlewares: aiogram.
- Check that the library supports the Bot API features you need (for example payments or business accounts) before committing.
Hosting is the same decision for all of them: polling needs an always-on process, webhooks can run on serverless. Best hosting for Telegram bots · Railway · Vultr
Related guides and tools
- Guide: Telegram bot in Python
- Tutorial: Telegram bot with grammY
- Telegram inline keyboards
- Free hosting for Telegram bots
- Webhook vs polling: hosting impact
- Best hosting for Telegram bots
Frequently asked questions
Which Telegram library is best for beginners?
python-telegram-bot in Python and grammY in JavaScript both have extensive beginner documentation. Pick by language.
Is Telegraf dead?
It is not archived and still works, but its last npm release was 4.16.3 in February 2024. For new projects grammY is the actively maintained choice.
Can I use the Bot API without a library?
Yes. It is plain HTTPS with JSON. Libraries add typing, update routing, retries and webhook helpers.