C

grammY vs Telegraf: which should your Telegram project use?

AI and automation

grammY vs Telegraf: which should your Telegram project use?

Choose by your existing code, your team's language and the Telegram features the project needs. Both libraries need a real application and an operating plan, and a working Telegraf bot does not automatically need a migration.

$49.99 USD / hour

Discuss your project Plan your project in 10 minutes

Published / Updated

Should a new Telegram project use grammY or Telegraf?

Start from the code you already have, the language your team maintains and the Telegram features the project needs, then pick the library. grammY and Telegraf are both MIT-licensed libraries for JavaScript and TypeScript. grammY's guide describes use on Node.js, Deno and in the browser, with sessions and conversations as separate documented features. Telegraf's site describes Node.js use with webhooks through Node's own web servers, Fastify or Express, and labels itself version 4.16.3 with support for Bot API 7.1. If the project needs a newer Telegram method, check how each library exposes it before you choose. That label alone does not prove Telegraf is abandoned. We have used both. Youth SDA UA, a youth ministry bot, runs on grammY with LiqPay and SQLite. Secret Room, a confidential bot between a church member and a pastor, runs on Telegraf and Node. Two projects are not a controlled test, so they do not settle the choice. The table adds two Python libraries and the custom route.

The table lists facts from each project's own documentation. A licence label describes the core library only, not hosting, support or a legal assessment.

Telegram bot libraries and the custom route: licence, language, state and limits from official docs and our records (checked 29 November 2026)
OptionLicence and price modelLanguage and stateKey limitCroscor experience
grammYgrammY: MIT-licensed core, no subscription.grammY: TypeScript or JavaScript on Node.js, Deno and in the browser. Sessions and conversations are documented separately.grammY: default session data is kept in RAM and lost when the bot stops. Add persistent storage for state that must survive.Youth SDA UA bot, with LiqPay and SQLite.
TelegrafTelegraf: MIT-licensed core, no subscription.Telegraf: JavaScript or TypeScript on Node.js. Webhooks through Node's own web servers, Fastify or Express.Telegraf: site labels version 4.16.3 with Bot API 7.1 support. Default sessions are memory-only; custom storage is supported.Secret Room bot, on Node.
python-telegram-botpython-telegram-bot: LGPL-3 licence, no subscription.python-telegram-bot: asynchronous Python, version 3.10 or later. ConversationHandler for multi-step dialogs.python-telegram-bot: ConversationHandler needs updates processed one by one, with concurrent_updates set to False.Not in our published projects.
aiogramaiogram: MIT-licensed core, no subscription.aiogram: Python 3.11 or later, asyncio, routers, middleware and a finite state machine.aiogram docs strongly advise prior asyncio experience. State storage and hosting are still yours to build.Not in our published projects.
Build your own workflowCroscor: work at $49.99 per hour. Hosting, database and integrations are separate. Telegram FAQ: default messaging is free.Any library above, or the Bot API directly. Writing a new framework is not required.Telegram FAQ: about 30 messages per second in bulk, 20 per minute to one group, about 1 per second per chat.Per their public records, Youth SDA UA is built on grammY and Secret Room on Telegraf.

Which workflow requirements should decide the shortlist?

List what the bot must do before you compare libraries. Write down each journey a user goes through, the data the bot stores, the outside systems it talks to, the texts staff need to edit without a developer, and any reply that must stay private. Then mark which of these depend on library features, such as multi-step conversations, sessions or webhook hosting, and which are ordinary application code that any library can carry. The list becomes the brief for an estimate and the test plan for the handover. Our two ministry bots show how different such lists can be. Youth SDA UA runs a youth congress inside Telegram, with registration and LiqPay payments, personal invite links, a camps catalogue and an AI admin copilot for staff, and 35 camps imported into the in-bot catalogue. Secret Room is a confidential bridge where questions reach a pastor without a name and answers come back privately, with editable texts. They are different jobs, not a contest between two bots.

The Secret Room record describes a workflow. It is not an audit of anonymity or security. If the bot must pass people into a customer record, our guide Custom CRM for a service business: what should you commission? covers that handoff.

  • Each user journey, step by step, with the messages the bot sends.
  • The data stored, where it is kept and for how long.
  • Integrations such as payments, a CRM or a spreadsheet.
  • Texts and settings staff edit without a developer.
  • Replies that must stay private, and who can read them.

What happens to sessions when the process restarts?

In both JavaScript libraries, default session data disappears when the process stops, so decide early where state must live. grammY's session documentation says default session data is held in RAM and lost when the bot stops, and its storage section explains how to supply persistent storage. Telegraf's session reference says the default store is in memory and is lost when the process ends, and it accepts custom storage. A bot process restarts for a deploy, a crash or a server move. A half-finished registration, a pending payment or a multi-step form held only in memory is lost at that moment. List each piece of state, mark what must survive a restart, and choose a database or storage adapter for that part. Then test it: start a conversation, restart the process and continue. Youth SDA UA's stack names SQLite as its database. The record does not say which fields or sessions are stored there, so take it as context, not a design to copy.

When should a Python team consider python-telegram-bot or aiogram instead?

Choose the language your team will maintain first, then compare libraries within it, rather than copying a Node tutorial into a Python team. python-telegram-bot is an LGPL-3 library with an asynchronous interface that its stable documentation says requires Python 3.10 or later. Its ConversationHandler manages multi-step dialogs, and the docs tell you to set concurrent_updates to False when you use it, because the handler relies on updates being processed one at a time. That constraint applies to that handler, not to every application. aiogram is MIT-licensed, and its documentation describes Python 3.11 or later, asyncio, routers, middleware and a finite state machine for dialogs. The same docs strongly advise prior asyncio experience. With either library you still build storage, hosting and integrations. Neither library is in our published projects. Secret Room was rewritten from Python to Node with editable texts. Its earlier Python code is not public, so it tells you nothing about these two libraries.

Do framework changes remove Telegram API limits?

Changing the library does not change what Telegram allows, because every library calls the same Bot API. Telegram's Bots FAQ says messaging through the Bot API is free by default and sets broadcasting limits: about 30 messages per second for bulk notifications, up to 20 messages per minute in one group, and roughly one message per second in a single chat. Paid broadcasts are a separate Telegram facility, not a way to send unlimited free messages. Plan sending queues, retries and announcement schedules around these limits whichever library you choose. The FAQ also explains the choice between polling for updates and receiving them by webhook. Make this choice deliberately, together with your hosting, because it affects how the bot is deployed and restarted. Youth SDA UA has 35 camps imported into its in-bot catalogue, sorted into 5 categories. That is catalog scope. It is not a traffic figure, a subscriber count or a test of the API limits, and we do not present it as one.

When is migrating an existing bot justified?

Migrate an existing bot only for a specific reason you can name: a Telegram feature the current library does not expose, a dependency that no longer receives fixes, or code your team cannot maintain. A comparison article that declares one library better is not such a reason. grammY's own comparison page, which asks readers to assume it is biased, discusses cases where keeping an existing Telegraf bot makes sense. Start with an inventory of what the bot does today: every command and handler, where state is stored, each multi-step dialog, scheduled jobs, and integrations such as payments or a CRM. Price the migration from that inventory and compare it with fixing the specific gap in place. Our only recorded rewrite is Secret Room, which moved from Python to Node with editable texts and runs on Telegraf. There is no Telegraf to grammY migration in our records, and there are no recorded hours for any rewrite, so we give no migration estimate here.

Keep the cost lines separate. Implementation, from the inventory to a tested handover, is our time at $49.99 per hour; ask for the estimate in writing first. Hosting, the database and paid integrations such as a payment provider are billed by those providers. Telegram's FAQ says default messaging is free, and paid broadcasts are a separate charge.

  • Commands and handlers, with what each one does.
  • State: what is stored, where, and what must survive a restart.
  • Dialogs: each multi-step conversation and its exits.
  • Scheduled work such as reminders or daily posts.
  • Integrations: payments, CRM, spreadsheets or AI services.
  • Texts and settings staff edit today.

What should a custom bot handover prove?

A handover should prove, on synthetic data, that the bot does what the brief says and survives ordinary failures. Ask the developer to run every required command in front of you. Restart the process in the middle of a multi-step dialog and confirm that the user can continue or is told clearly what to do. Send the same update twice and check that it is processed once, for example that a registration is not created twice. Break one integration on purpose, such as the payment callback, and confirm that the failure is logged and someone is alerted. Have a staff member change a bot text through the agreed editing path and see it live. Finally, check that the bot token, the server and the code repository are registered to your organisation. These are proposed acceptance tests, not results from our projects. Youth SDA UA covers congress registration and LiqPay payments, and Secret Room has editable texts. Those are scope examples only.

If the bot is part of an event with registration, payments and check-in, our guide Church conference registration software: which setup fits? covers that buying decision. This guide covers the library choice.

  • Every required command works on synthetic data.
  • A restart in the middle of a dialog keeps or clearly resets the user's place.
  • A duplicate update is processed once.
  • A broken integration is logged and alerted.
  • A staff member edits a text and sees it live.
  • The token, server and repository belong to your organisation.

Project examples

Youth SDA UA

The public bot profile lists 3 tools: a camp catalogue, event help and a Bible AI assistant.

Source

Sources

Start with what you need

Tell us what you want to build or improve. We can discuss the scope and the work it takes. Prefer to start on your own? A short guided brief takes about 10 minutes and ends with a plan drafted by AI.

Cart (0 items)