New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More โ†’
Socket
Sign inDemoInstall
Socket

grammy

Package Overview
Dependencies
Maintainers
0
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grammy

The Telegram Bot Framework.

  • 1.34.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18K
decreased by-43.82%
Maintainers
0
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. We are also on Twitter.

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

๐Ÿ“–
trgwii
trgwii

๐Ÿ’ป ๐Ÿ‘€
KnightNiwrem
KnightNiwrem

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

๐Ÿ‘€
EdJoPaTo
EdJoPaTo

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

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

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

๐Ÿ›
Ciki Momogi
Ciki Momogi

๐Ÿ“– ๐ŸŒ
AndreoliBR
AndreoliBR

๐Ÿ‘€
Kirill Loskutov
Kirill Loskutov

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

๐Ÿ› ๐Ÿ‘€
code-withAshish
code-withAshish

๐Ÿ“– ๐Ÿ’ฌ ๐Ÿ› ๐Ÿ‘€
Stephane Mensah
Stephane Mensah

๐Ÿ› ๐Ÿ”Œ
Asaku01
Asaku01

๐Ÿ“–
ppsimn
ppsimn

๐Ÿ›
Satont
Satont

๐Ÿ”Œ ๐Ÿ“–
deptyped
deptyped

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

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

๐Ÿ’ป
Ikko Ashimine
Ikko Ashimine

๐Ÿ“–
Yevhen Denesiuk
Yevhen Denesiuk

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

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

๐Ÿค”
kospra
kospra

๐Ÿค” ๐Ÿ’ป
Chimit
Chimit

๐Ÿ“–
Calsi
Calsi

๐Ÿ“–
Jonas Zohren
Jonas Zohren

๐Ÿ› ๐Ÿ’ป
linbuxiao
linbuxiao

๐Ÿ“– ๐ŸŒ
JiquanWang99
JiquanWang99

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

๐Ÿ”Œ
WingLim
WingLim

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

๐Ÿ“– ๐ŸŒ
Merlin
Merlin

๐Ÿ“–
Darvesh
Darvesh

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

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

๐Ÿ“– ๐ŸŒ
Slava Fomin II
Slava Fomin II

๐Ÿ› ๐Ÿ“–
Kiko Beats
Kiko Beats

๐Ÿ“–
Vsevolod
Vsevolod

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

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

๐Ÿ”Œ
Vitaliy Meshchaninov
Vitaliy Meshchaninov

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

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

๐Ÿ“–
Ilya Semenov
Ilya Semenov

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

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

๐Ÿ“–
Hesoyam
Hesoyam

๐Ÿ“–
yrzam
yrzam

๐Ÿ›
drmikecrowe
drmikecrowe

๐Ÿ‘€
Martin
Martin

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

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

๐Ÿ’ก
x066it
x066it

๐Ÿ› ๐Ÿ‘€
kolay
kolay

๐Ÿ‘€
Evgeny Nepomnyashchiy
Evgeny Nepomnyashchiy

๐Ÿ‘€
Ananta Krsna dasa
Ananta Krsna dasa

๐Ÿ“–
Mighty Ali
Mighty Ali

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

๐Ÿ› ๐Ÿ’ป
Roz
Roz

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

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

๐Ÿ“–
Alisher Ortiqov
Alisher Ortiqov

๐Ÿ“–
Tony Tkachenko
Tony Tkachenko

๐Ÿ“–
Ra
Ra

๐Ÿ’ป
sartoshi-foot-dao
sartoshi-foot-dao

๐Ÿ“–
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

๐Ÿ’ป
abdoo9
abdoo9

๐Ÿ› ๐Ÿ’ป ๐Ÿ‘€ ๐Ÿ“–
ak4zh
ak4zh

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

๐Ÿ’ป
Aquatica
Aquatica

๐Ÿ“– ๐Ÿ’ฌ
Fa Dzikri
Fa Dzikri

๐Ÿ‘€ ๐Ÿ“– ๐ŸŒ
Chandler Lattin
Chandler Lattin

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

๐Ÿ›
ร‰merson Felinto
ร‰merson 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

๐Ÿ“– โœ…
Stephan Psaras
Stephan Psaras

๐Ÿ›
shevernitskiy
shevernitskiy

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

๐Ÿ“–
Andrii Zontov
Andrii Zontov

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

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

๐Ÿ› ๐Ÿ’ป
NDA
NDA

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

๐Ÿ“–
Chris Andrew C. L.
Chris Andrew C. L.

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

๐Ÿ’ป
Shane Avery Sistoza
Shane Avery Sistoza

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

๐Ÿ’ป
Nazar Antoniuk
Nazar Antoniuk

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

๐Ÿ‘€
Vladislav Ponomarev
Vladislav Ponomarev

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

๐Ÿ‘€
Leandro Vargas
Leandro Vargas

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

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

๐Ÿค” ๐Ÿ‘€
Sree (Taylor's Version)
Sree (Taylor's Version)

๐Ÿ› ๐Ÿ’ป
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

๐Ÿ”Œ
Ubertao
Ubertao

๐Ÿค” ๐Ÿ’ป
Grigory
Grigory

๐Ÿค” ๐Ÿ’ป ๐Ÿ“–
aleveha
aleveha

๐Ÿ’ป
barinbritva
barinbritva

๐Ÿ‘€
Lyudmil Ivanov
Lyudmil Ivanov

๐Ÿ’ก
lexomis
lexomis

๐Ÿ‘€
Andrew Sologor
Andrew Sologor

๐Ÿ‘€
rayz
rayz

๐Ÿ’ฌ ๐Ÿค” ๐Ÿ’ป
Zaid
Zaid

๐Ÿ”ง
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

๐Ÿ“–

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

Keywords

FAQs

Package last updated on 27 Jan 2025

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc