Telegram
How to make a Telegram bot
Create a Telegram bot end to end: getting a token from BotFather, handling commands with grammY, and generating a working bot from a sentence with Devellix.
5 min read · Updated Jul 28, 2026
A Telegram bot is an account controlled by code that can reply to commands, run reminders, tally polls, or connect a service to a chat. Telegram makes bots first-class: you register one with BotFather and talk to the Bot API over a simple token.
The clean modern stack is Node.js with the grammY library. This guide covers getting a token, the shape of a bot, and how to generate the whole thing from a description.
Step by step
- 1
Get a token from BotFather
Open BotFather in Telegram, send /newbot, and choose a name and username. BotFather returns a token that authenticates your code as the bot. Keep it in an environment variable, never in the source.
- 2
Understand a grammY bot
A grammY bot creates a Bot with the token, registers handlers for commands like /start and /remind, and calls start to begin receiving updates. Handlers read the message, do the work, and reply.
- 3
Handle commands and input
Commands parse their arguments from the message text, validate them, and respond. A reminder bot, for example, reads a number of minutes and a message, confirms, and schedules the reply. Good bots validate input and give a clear usage hint when it is wrong.
- 4
Generate the bot with Devellix
Describe the bot on Devellix and pick Telegram. It writes a grammY project in TypeScript, installs the dependencies, and bundles it. You add your BotFather token and run it.
- 5
Run it and keep it online
Start the bot process and it connects to Telegram and responds. For a bot that must always be available, run it on a small server or process manager. You own the code, so hosting is up to you.
What you can build
- A reminder bot: /remind <minutes> <text> that pings you on time
- A poll bot that tallies votes with inline buttons
- A bot that fetches and posts data from an API on command
- A group welcome bot with rules and buttons
- A notification bot that relays alerts into a chat