grammY
The Telegram Bot Framework.
Easy to Use
grammY makes creating Telegram bots so simple you already know how to do it.
Flexible
grammY is open and can be extended by plugins to make it fit exactly your needs.
Scalable
grammY has you covered when your bot gets popular and the traffic increases.
… a new era of bot development.
Quickstart
Bots are written in TypeScriptopen in new window (or JavaScript) and run on various platforms, including Node.jsopen in new window.
npm install grammy
and paste the following code:
import { Bot } from "grammy";
const bot = new Bot(""); // <-- put your bot token here (https://t.me/BotFather)
// Reply to any message with "Hi there!".
bot.on("message", (ctx) => ctx.reply("Hi there!"));
bot.start();
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
const { Bot } = require("grammy");
const bot = new Bot(""); // <-- put your bot token here (https://t.me/BotFather)
// Reply to any message with "Hi there!".
bot.on("message", (ctx) => ctx.reply("Hi there!"));
bot.start();
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
import { Bot } from "https://deno.land/x/grammy/mod.ts";
const bot = new Bot(""); // <-- put your bot token here (https://t.me/BotFather)
// Reply to any message with "Hi there!".
bot.on("message", (ctx) => ctx.reply("Hi there!"));
bot.start();
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Works! 🎉
grammY supports the Telegram Bot API 5.5 which was releasedopen in new window on December 7, 2021. (Last highlight: Responses to Join Requests)