Launch Week Day 1: Socket for Jira Is Now Available.Learn More โ†’
Socket
Book a DemoSign in
Socket

grammy

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grammy

The Telegram Bot Framework.

latest
Source
npmnpm
Version
1.42.0
Version published
Weekly downloads
1.3M
-21.71%
Maintainers
1
Weekly downloads
ย 
Created
Source
grammY

The Telegram Bot Framework

Bot API Deno npm All Contributors

docs. reference. chat. 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 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 (or JavaScript) and run on Node.js or Deno.

Quickstart

If you are new to Telegram bots, read the official Introduction for Developers written by the Telegram team.

Visit @BotFather and create a new bot. You will obtain a bot token.

Create a new directory and run

npm install grammy

inside it. Then create a file bot.js with this content:

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

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, and an API Reference. It even integrates with your code editor, e.g. VS Code. 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 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

โ€”main project website and documentation. Gets you started and explains all concepts.

grammY API reference

โ€”reference of everything that grammY exports. Useful to look up descriptions about any element of grammY.

grammY examples

โ€”repository full of example bots. Includes a setup to easily run any of them.

Awesome grammY

โ€”list of awesome projects built with grammY. Helpful if you want to see some real-world usage.

grammY chat

โ€”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.

grammY news

โ€”The channel where updates to grammY and the ecosystem are posted.

Telegram Bot API Reference

โ€”documentation of the API that Telegram offers, and that grammY connects to under the hood.

Deno Support

All grammY packages published by @grammyjs run natively on Deno. 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.

You may also be interested in why we support Deno.

JavaScript Bundles

The grammY core package in this repository is available as a JavaScript bundle via https://bundle.deno.dev/. 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 https://bundle.deno.dev/https://raw.githubusercontent.com/grammyjs/grammY/main/src/mod.ts.

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 ยป

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

KnorpelSenf
KnorpelSenf

๐Ÿค” ๐Ÿ’ป ๐Ÿ“– ๐ŸŽจ ๐Ÿ’ก โš ๏ธ ๐Ÿ”Œ ๐Ÿ“ฆ ๐Ÿ‘€ ๐Ÿง‘โ€๐Ÿซ ๐Ÿ“† ๐Ÿš‡ ๐Ÿ”Š ๏ธ๏ธ๏ธ๏ธโ™ฟ๏ธ ๐Ÿ“ข
Heero
Heero

๐Ÿ”Œ ๐Ÿ““ ๐Ÿ’ก ๐Ÿ“– ๐Ÿ‘€ ๐Ÿ’ป ๐Ÿค”
Wojciech Pawlik
Wojciech Pawlik

๐Ÿค” ๐Ÿ‘€ ๐Ÿš‡ ๐Ÿ“ฆ ๐Ÿ”ง ๐Ÿ’ป
Alessandro Bertozzi
Alessandro Bertozzi

๐Ÿ“–
Thomas
Thomas

๐Ÿ’ป ๐Ÿ‘€
KnightNiwrem
KnightNiwrem

๐Ÿ’ป ๐Ÿ› ๐Ÿ”Œ ๐Ÿ“– ๐Ÿ’ก ๐Ÿ‘€ ๐Ÿง‘โ€๐Ÿซ
Muthu Kumar
Muthu Kumar

๐Ÿ‘€ ๐Ÿ› ๐Ÿ’ป
EdJoPaTo
EdJoPaTo

๐Ÿ”Œ ๐Ÿ“– ๐Ÿค” ๐Ÿ‘€ ๐Ÿ› ๐Ÿ’ป
Amir Zouerami
Amir Zouerami

๐Ÿ“– ๐Ÿ”Œ ๐Ÿ’ก
Roj
Roj

๐Ÿ“– ๐Ÿ‘€ ๐Ÿš‡ ๐ŸŒ ๐Ÿ’ป ๐Ÿค” ๐Ÿง‘โ€๐Ÿซ ๐Ÿ’ก
jokasimr
jokasimr

๐Ÿ›
Qz
Qz

๐Ÿ“– ๐ŸŒ
AndreoliBR
AndreoliBR

๐Ÿ‘€
Kirill Loskutov
Kirill Loskutov

๐Ÿ“– ๐Ÿ› ๐Ÿค” ๐ŸŽจ ๐Ÿ’ฌ ๐Ÿ‘€ ๐Ÿ’ป ๐Ÿ”Œ
AndrewLaneX
AndrewLaneX

๐Ÿ› ๐Ÿ‘€
Ashish Bhushan Kumar
Ashish Bhushan Kumar

๐Ÿ“– ๐Ÿ’ฌ ๐Ÿ› ๐Ÿ‘€
TheVirginBrokey
TheVirginBrokey

๐Ÿ› ๐Ÿ”Œ
Asaku01
Asaku01

๐Ÿ“–
ppsimn
ppsimn

๐Ÿ›
Alexander
Alexander

๐Ÿ”Œ ๐Ÿ“–
deptyped
deptyped

๐Ÿ’ก ๐Ÿ“– โœ… ๐Ÿ› ๐ŸŒ
Jacek Nowacki
Jacek Nowacki

๐Ÿ“– ๐Ÿ’ป ๐Ÿ› ๐Ÿ‘€ ๐Ÿค”
Outvi V
Outvi V

๐Ÿ’ป
Ikko Eltociear Ashimine
Ikko Eltociear Ashimine

๐Ÿ“–
Yevhen Denesiuk
Yevhen Denesiuk

๐Ÿ‘€ ๐Ÿ› ๐Ÿ’ป
Galih
Galih

๐Ÿ› ๐Ÿ’ป
Sayem Chowdhury
Sayem Chowdhury

๐Ÿค”
kospra
kospra

๐Ÿค” ๐Ÿ’ป
Chimit
Chimit

๐Ÿ“–
Calsi
Calsi

๐Ÿ“–
Jonas Zohren
Jonas Zohren

๐Ÿ› ๐Ÿ’ป
linbuxiao
linbuxiao

๐Ÿ“– ๐ŸŒ
PuffMeow
PuffMeow

๐Ÿ“– ๐ŸŒ
Borhan Hafez
Borhan Hafez

๐Ÿ”Œ
WingLim
WingLim

๐Ÿ“– ๐ŸŒ ๐Ÿ’ป ๐Ÿ”Œ ๐Ÿค”
taotie111
taotie111

๐Ÿ“– ๐ŸŒ
Merlin
Merlin

๐Ÿ“–
Darvesh
Darvesh

๐Ÿ› ๐Ÿ’ป ๐Ÿ‘€
Dunkan
Dunkan

๐Ÿ› ๐Ÿ’ป ๐Ÿ”Œ ๐Ÿ‘€ ๐Ÿ“– ๐Ÿค” ๐Ÿš‡ ๐Ÿ”ง ๐Ÿง‘โ€๐Ÿซ ๐Ÿšง
Kid
Kid

๐Ÿ“– ๐ŸŒ
Slava
Slava

๐Ÿ› ๐Ÿ“–
Jose Francisco 'Kiko' Verdรบ Gambรญn
Jose Francisco 'Kiko' Verdรบ Gambรญn

๐Ÿ“–
Wsevolod
Wsevolod

๐Ÿ’ป ๐Ÿค” ๐Ÿ‘€
Habemuscode
Habemuscode

๐Ÿ‘€ ๐Ÿ“– ๐ŸŒ ๐Ÿšง
Nikita Kolmogorov
Nikita Kolmogorov

๐Ÿ”Œ
Vitalii Meshchaninov
Vitalii Meshchaninov

๐Ÿ› ๐Ÿ’ป
ะ”ะธะปัะฝ ะŸะฐะปะฐัƒะทะพะฒ
ะ”ะธะปัะฝ ะŸะฐะปะฐัƒะทะพะฒ

๐Ÿ› ๐Ÿ’ป
lmx-Hexagram
lmx-Hexagram

๐Ÿ“–
Ilya Semenov
Ilya Semenov

๐Ÿค” ๐Ÿ‘€ ๐Ÿ’ป
abdollahzadehAli
abdollahzadehAli

๐Ÿ“– ๐Ÿ’ก
Saeed Nasiri
Saeed Nasiri

๐Ÿ“–
Hesoyam
Hesoyam

๐Ÿ“–
Yuri Zamyatin
Yuri Zamyatin

๐Ÿ›
drmikecrowe
drmikecrowe

๐Ÿ‘€
Martin
Martin

๐Ÿ“– ๐Ÿ› ๐Ÿ‘€
Pavlo
Pavlo

๐Ÿ’ก
Thor ้›ท็ฅž Schaeff
Thor ้›ท็ฅž Schaeff

๐Ÿ’ก
x066it
x066it

๐Ÿ› ๐Ÿ‘€
kolay
kolay

๐Ÿ‘€
Eugen Nemann
Eugen Nemann

๐Ÿ‘€
northen-mindset
northen-mindset

๐Ÿ“–
Ali Alshaikh
Ali Alshaikh

๐Ÿ’ป ๐Ÿ‘€ ๐Ÿค”
ไธ‰ไธ‰
ไธ‰ไธ‰

๐Ÿ› ๐Ÿ’ป
Roz
Roz

๐Ÿ› ๐Ÿ’ป ๐Ÿ‘€ ๐Ÿš‡ ๐Ÿค” ๐Ÿง‘โ€๐Ÿซ ๐Ÿ”Œ
Dani Haro
Dani Haro

๐Ÿ’ป ๐Ÿ”Œ ๐Ÿ“–
Akash
Akash

๐Ÿ“–
Alisher Ortiqov
Alisher Ortiqov

๐Ÿ“–
Tony
Tony

๐Ÿ“–
Ra
Ra

๐Ÿ’ป
Ziding Zhang
Ziding Zhang

๐Ÿ“–
Yoel Navas E.
Yoel Navas E.

๐Ÿค”
Vitor Gomes
Vitor Gomes

๐Ÿ› ๐Ÿ’ป
Aditya
Aditya

๐Ÿ› ๐Ÿ‘€
Udit Karode
Udit Karode

๐Ÿ‘€
Mike Rockรฉtt
Mike Rockรฉtt

๐Ÿ‘€ ๐Ÿ›
Srinivasa IK Varanasi
Srinivasa IK Varanasi

๐Ÿ’ป
Akash Agarwal
Akash Agarwal

๐Ÿ‘€ ๐Ÿค” ๐Ÿ’ป
Nick Lapshin
Nick Lapshin

๐Ÿ’ป
Aquatica
Aquatica

๐Ÿ“– ๐Ÿ’ฌ
Chandler
Chandler

๐Ÿ’ป ๐Ÿ‘€ ๐Ÿ”Œ
Sergey Parfenyuk
Sergey Parfenyuk

๐Ÿ›
Felinto
Felinto

๐Ÿ›
Petr Stankin
Petr Stankin

๐Ÿ›
Maxim Lebedev
Maxim Lebedev

๐Ÿค” ๐Ÿ’ป
Madnex
Madnex

๐Ÿ“–
Svyatoslav Tupchienko
Svyatoslav Tupchienko

๐Ÿ’ป
Vladislav Deryabkin
Vladislav Deryabkin

๐Ÿ› ๐Ÿ’ป ๐Ÿ‘€
Kashyap Sharma
Kashyap Sharma

๐Ÿ’ก
AlexOwl
AlexOwl

๐Ÿ› ๐Ÿ’ป
Shrimadhav U K
Shrimadhav U K

๐Ÿ’ป ๐Ÿค” โš ๏ธ
Binamra Lamsal
Binamra Lamsal

๐Ÿค”
gertminov
gertminov

๐Ÿ“– โœ…
sp.wack
sp.wack

๐Ÿ›
shevernitskiy
shevernitskiy

๐Ÿ› ๐Ÿ‘€ ๐Ÿ’ป
Raghunandan Jhanwar
Raghunandan Jhanwar

๐Ÿ“–
Andrii Zontov
Andrii Zontov

๐Ÿ› ๐Ÿ’ป ๐Ÿ’ฌ ๐Ÿค” ๐Ÿ“– ๐ŸŒ
Abbass Al-Musawi
Abbass Al-Musawi

๐Ÿ“– ๐Ÿ› ๐Ÿ’ป
ArunR
ArunR

๐Ÿ› ๐Ÿ’ป ๐Ÿค” โš ๏ธ ๐Ÿš‡
NDA
NDA

๐Ÿ› ๐Ÿค” ๐Ÿ’ป
MatyiFKBT
MatyiFKBT

๐Ÿ“–
Chris Lopes
Chris Lopes

๐Ÿ› ๐Ÿ’ป ๐Ÿ‘€
Islam Kiiasov
Islam Kiiasov

๐Ÿ’ป
Shane Avery Sistoza
Shane Avery Sistoza

๐Ÿค” ๐Ÿ’ป โš ๏ธ
Maicol
Maicol

๐Ÿ’ป
Nazar-Ant
Nazar-Ant

๐Ÿ“– ๐ŸŒ ๐Ÿšง
Aleksei Ivanov
Aleksei Ivanov

๐Ÿ‘€
Vladislav Ponomarev
Vladislav Ponomarev

โš ๏ธ ๐Ÿ’ป ๐Ÿ“ฆ
Louie Tan
Louie Tan

๐Ÿ‘€
Leandro Vargas
Leandro Vargas

๐Ÿ› ๐Ÿ’ป
Sean Yap
Sean Yap

๐Ÿ› ๐Ÿ’ป
Sergey Solovev
Sergey Solovev

๐Ÿค” ๐Ÿ‘€
0xArchitect
0xArchitect

๐Ÿ› ๐Ÿ’ป
Yaroslav Vovchenko
Yaroslav Vovchenko

๐Ÿ› ๐Ÿ’ป
gabe
gabe

๐Ÿ‘€
Lavrentiy Rubtsov
Lavrentiy Rubtsov

๐Ÿ“–
Josh Gillies
Josh Gillies

๐Ÿ’ป
Uladzislau Hramyka
Uladzislau Hramyka

๐Ÿ›
Gabriele Belluardo
Gabriele Belluardo

๐Ÿ› ๐Ÿ’ป
Dim Chen
Dim Chen

๐Ÿ› ๐Ÿ’ป
fwqaaq
fwqaaq

๐Ÿค” ๐Ÿ’ป
Janek Szynal
Janek Szynal

๐Ÿค”
Alexander Mordvinov
Alexander Mordvinov

๐Ÿค”
Ash
Ash

๐Ÿ‘€
Winston H.
Winston H.

๐Ÿค” ๐Ÿ’ป ๐Ÿ‘€ โš ๏ธ
Hero Protagonist
Hero Protagonist

๐Ÿ’ป ๐Ÿ› ๐Ÿค” ๐Ÿ”Œ
Mobin Askari
Mobin Askari

๐Ÿ”Œ ๐Ÿ‘€
Unotao
Unotao

๐Ÿค” ๐Ÿ’ป
Grigory
Grigory

๐Ÿค” ๐Ÿ’ป ๐Ÿ“–
Nikita Tashchilin
Nikita Tashchilin

๐Ÿ’ป
barinbritva
barinbritva

๐Ÿ‘€
Lyudmil Ivanov
Lyudmil Ivanov

๐Ÿ’ก
lexomis
lexomis

๐Ÿ‘€
Andrew Sologor
Andrew Sologor

๐Ÿ‘€
rayz
rayz

๐Ÿ’ฌ ๐Ÿค” ๐Ÿ’ป ๐Ÿ“–
Zaยกd
Zaยกd

๐Ÿ”ง
Mat Milbury
Mat Milbury

๐Ÿ› ๐Ÿ’ป
Shibo Lyu
Shibo Lyu

๐Ÿ’ป
Mased
Mased

๐ŸŒ ๐Ÿ“–
Artem Prokop
Artem Prokop

๐Ÿ““
Sรฉrgio Rebelo
Sรฉrgio Rebelo

๐Ÿ‘€
Igor Katsuba
Igor Katsuba

๐Ÿค” ๐Ÿ’ป
Oyatillo
Oyatillo

๐Ÿ‘€ ๐Ÿ› ๐Ÿ’ป
Mordechai Dror
Mordechai Dror

๐Ÿ‘€
mahovich
mahovich

๐Ÿ“–
Thร nh Hoร ng Trแบงn
Thร nh Hoร ng Trแบงn

๐Ÿ“–
ikelax
ikelax

๐Ÿ“–
Lutymane
Lutymane

๐Ÿ’ป
Thada Wangthammang
Thada Wangthammang

๐Ÿ› โš ๏ธ ๐Ÿ‘€
Konstantin Ryshkov
Konstantin Ryshkov

๐Ÿ› ๐Ÿ“–
Mishkat
Mishkat

๐Ÿ› ๐Ÿ’ป
Dmytro Tiapukhin
Dmytro Tiapukhin

๐Ÿ“–
Alexander
Alexander

๐Ÿ“–
Codinary
Codinary

๐Ÿ‘€
.vhs
.vhs

๐Ÿ› ๐Ÿ‘€
agoudbg
agoudbg

๐Ÿ› ๐Ÿ’ป
A
A

๐Ÿ› ๐Ÿ‘€
Harold Hunt
Harold Hunt

๐Ÿ› ๐Ÿ’ป โš ๏ธ
GlacierPhonkโ„ข
GlacierPhonkโ„ข

๐Ÿ› ๐Ÿ’ป ๐Ÿšง

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

telegram

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts