https://github.com/grammyjs/grammy
The Telegram Bot Framework.
https://github.com/grammyjs/grammy
bot deno javascript nodejs telegram telegram-bot typescript
Last synced: 6 months ago
JSON representation
The Telegram Bot Framework.
- Host: GitHub
- URL: https://github.com/grammyjs/grammy
- Owner: grammyjs
- License: mit
- Created: 2021-03-26T22:33:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-30T09:45:04.000Z (6 months ago)
- Last Synced: 2025-05-11T13:59:15.728Z (6 months ago)
- Topics: bot, deno, javascript, nodejs, telegram, telegram-bot, typescript
- Language: TypeScript
- Homepage: https://grammy.dev
- Size: 1.63 MB
- Stars: 2,750
- Watchers: 27
- Forks: 131
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-deno - grammY - Telegram Bot API framework for Deno. (Modules / Social Platform APIs)
README
# The Telegram Bot Framework
[](https://core.telegram.org/bots/api)
[](https://deno.land/x/grammy)
[](https://www.npmjs.org/package/grammy)
[](#contributors-)
## _[docs.](https://grammy.dev) [reference.](https://grammy.dev/ref) [chat.](https://telegram.me/grammyjs) [news.](https://telegram.me/grammyjs_news)_
**grammY makes it easy to create Telegram bots.** Both for beginners and at scale.
You want grammY because it is easy to use. It is very powerful and always up to date. It has the best [documentation](https://grammy.dev) in town. It is extremely efficient and scales up effortlessly. It has a thriving ecosystem of plugins, a friendly community chat, seamless integrations with web frameworks and databases, and so much more.
Are you ready? π€π
Bots are written in [TypeScript](https://www.typescriptlang.org/) (or JavaScript) and run on [Node.js](https://nodejs.org/) or [Deno](#deno-support).
## Quickstart
> If you are new to Telegram bots, read the official [Introduction for Developers](https://core.telegram.org/bots) written by the Telegram team.
Visit [@BotFather](https://t.me/BotFather) and create a new bot. You will obtain a **bot token**.
Create a new directory and run
```bash
npm install grammy
```
inside it. Then create a file `bot.js` with this content:
```ts
const { Bot } = require("grammy");
// Create a bot object
const bot = new Bot(""); // <-- place your bot token in this string
// Register listeners to handle messages
bot.on("message:text", (ctx) => ctx.reply("Echo: " + ctx.message.text));
// Start the bot (using long polling)
bot.start();
```
Now you can run the bot via
```bash
node bot.js
```
and it will echo all received text messages.
Congrats! You just wrote a Telegram bot :)
## Going Further
grammY has an excellent [documentation](https://grammy.dev), and an [API Reference](https://grammy.dev/ref). It even integrates with your code editor, e.g. [VS Code](https://code.visualstudio.com/). You can hover over any element of grammY to get a detailed description of what that thing does or means.
If you are still stuck, just join the [Telegram chat](https://t.me/grammyjs) and ask for help. People are nice there and we appreciate your question, no matter what it is :)
Here are some more resources to support you:
## Resources
### [grammY website](https://grammy.dev)
βmain project website and documentation.
Gets you started and explains all concepts.
### [grammY API reference](https://grammy.dev/ref)
βreference of everything that grammY exports.
Useful to look up descriptions about any element of grammY.
### [grammY examples](https://github.com/grammyjs/examples)
βrepository full of example bots.
Includes a setup to easily run any of them.
### [Awesome grammY](https://github.com/grammyjs/awesome-grammY)
βlist of awesome projects built with grammY.
Helpful if you want to see some real-world usage.
### [grammY chat](https://t.me/grammyjs)
βThe chat where you can ask any question about grammY or bots in general.
We are also open for feedback, ideas, and contributions!
The Russian community chat can be found [here](https://t.me/grammyjs_ru).
### [grammY news](https://t.me/grammyjs_news)
βThe channel where updates to grammY and the ecosystem are posted.
We are also [on Twitter](https://twitter.com/grammy_js).
### [Telegram Bot API Reference](https://core.telegram.org/bots/api)
βdocumentation of the API that Telegram offers, and that grammY connects to under the hood.
## Deno Support
All grammY packages published by [@grammyjs](https://github.com/grammyjs) run natively on [Deno](https://deno.land). We are compiling every codebase to still run on Node.js.
However, given that most bot developers are still using Node.js, all documentation is written Node.js-first. We may migrate it if Deno overtakes Node.js. If you are already on Deno today, import grammY from [`https://deno.land/x/grammy/mod.ts`](https://deno.land/x/grammy).
You may also be interested in [why we support Deno](https://grammy.dev/resources/faq.html#why-do-you-support-deno).
## JavaScript Bundles
The grammY core package in this repository is available as a JavaScript bundle via .
This lets you transpile all published versions including current `main` branch to standalone JavaScript files.
For example, the most recent source on `main` is available from .
Being compatible with browsers is especially useful for running bots on Cloudflare Workers.
For this reason, we also include a web bundle in our npm package.
You can simply do `import { Bot } from "grammy/web"`.
## [Contribution Guide Β»](./CONTRIBUTING.md)
## Contributors β¨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

KnorpelSenf
π€ π» π π¨ π‘ β οΈ π π¦ π π§βπ« π π π οΈοΈοΈοΈβΏοΈ π’

Heero
π π π‘ π π π» π€

Wojciech Pawlik
π€ π π π¦ π§ π»

Alessandro Bertozzi
π

trgwii
π» π

KnightNiwrem
π» π π π π‘ π π§βπ«

Muthu Kumar
π

EdJoPaTo
π π π€ π π π»

Amir Zouerami
π π π‘

Roj
π π π π π» π€ π§βπ« π‘

jokasimr
π

Ciki Momogi
π π

AndreoliBR
π

Kirill Loskutov
π π π€ π¨ π¬ π π» π

Andrew Lane
π π

code-withAshish
π π¬ π π

Stephane Mensah
π π

Asaku01
π

ppsimn
π

Satont
π π

deptyped
π‘ π β
π π

Jacek Nowacki
π π» π π π€

Outvi V
π»

Ikko Ashimine
π

Yevhen Denesiuk
π π π»

prastian
π π»

Sayem Chowdhury
π€

kospra
π€ π»

Chimit
π

Calsi
π

Jonas Zohren
π π»

linbuxiao
π π

JiquanWang99
π π

Borhan Hafez
π

WingLim
π π π» π π€

taotie111
π π

Merlin
π

Darvesh
π π» π

dcdunkan
π π» π π π π€ π π§ π§βπ« π§

Kid
π π

Slava Fomin II
π π

Kiko Beats
π

Vsevolod
π» π€ π

Habemuscode
π π π π§

Nikita Kolmogorov
π

Vitaliy Meshchaninov
π π»

ΠΠΈΠ»ΡΠ½ ΠΠ°Π»Π°ΡΠ·ΠΎΠ²
π π»

lmx-Hexagram
π

Ilya Semenov
π€ π π»

abdollahzadehAli
π π‘

Saeed Nasiri
π

Hesoyam
π

yrzam
π

drmikecrowe
π

Martin
π π π

Pavel
π‘

Thor ι·η₯ Schaeff
π‘

x066it
π π

kolay
π

Evgeny Nepomnyashchiy
π

Ananta Krsna dasa
π

Mighty Ali
π» π π€

δΈδΈ
π π»

Roz
π π» π π π€ π§βπ« π

Dani Haro
π» π π

Ryukaizen
π

Alisher Ortiqov
π

Tony Tkachenko
π

Ra
π»

sartoshi-foot-dao
π

Yoel Navas E.
π€

Vitor Gomes
π π»

Aditya
π π

Udit Karode
π

Mike RockΓ©tt
π π

Srinivasa IK Varanasi
π»

abdoo9
π π» π π

ak4zh
π π€ π»

Nikolay Lapshin
π»

Aquatica
π π¬

Fa Dzikri
π π π

Chandler Lattin
π» π π

Sergey Parfenyuk
π

Γmerson Felinto
π

Petr Stankin
π

Maxim Lebedev
π€ π»

Madnex
π

Svyatoslav Tupchienko
π»

Vladislav Deryabkin
π π» π

Kashyap Sharma
π‘

AlexOwl
π π»

Shrimadhav U K
π» π€ β οΈ

Binamra Lamsal
π€

gertminov
π β

Stephan Psaras
π

shevernitskiy
π π π»

mrmaster009
π

Andrii Zontov
π π» π¬ π€ π π

Abbass Al-Musawi
π π π»

ArunR
π π»

NDA
π π€ π»

MatyiFKBT
π

Chris Andrew C. L.
π π» π

Islam Kiiasov
π»

Shane Avery Sistoza
π€ π» β οΈ

Maicol
π»

Nazar Antoniuk
π π π§

Aleksei Ivanov
π

Vladislav Ponomarev
β οΈ π» π¦

Louie Tan
π

Leandro Vargas
π π»

Sean Yap
π π»

Sergey Solovev
π€ π

Sree (Taylor's Version)
π π»

Yaroslav Vovchenko
π π»

gabe
π

Lavrentiy Rubtsov
π

Josh Gillies
π»

Uladzislau Hramyka
π

Gabriele Belluardo
π π»

Dim Chen
π π»

fwqaaq
π€ π»

Janek Szynal
π€

Alexander Mordvinov
π€

Ash
π

Winston H.
π€ π» π β οΈ

Hero Protagonist
π» π π€ π

Mobin Askari
π

Ubertao
π€ π»

Grigory
π€ π» π

aleveha
π»

barinbritva
π

Lyudmil Ivanov
π‘

lexomis
π

Andrew Sologor
π

rayz
π¬ π€ π» π

Zaid
π§

Mat Milbury
π π»

Shibo Lyu
π»

Mased
π π

Artem Prokop
π

SΓ©rgio Rebelo
π

Igor Katsuba
π€ π»

Oyatillo
π π π»

Mordechai Dror
π

mahovich
π

ThΓ nh HoΓ ng TrαΊ§n
π

ikelax
π

Lutymane
π»

Thada Wangthammang
π β οΈ π

Konstantin Ryshkov
π

mish
π π»

Dmytro Tiapukhin
π

Alexander
π

Codinary
π
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
Contributions of any kind welcome!
