Skip to content

grammY

The Telegram Bot Framework.

a new era of bot development.

grammY logo

Quickstart

Bots are written in TypeScript (or JavaScript) and run on various platforms, including Node.js.

npm install grammy and paste the following code:

ts
import { Bot } from "grammy";

const bot = new Bot(""); // <-- put your bot token between the "" (https://t.me/BotFather)

// Reply to any message with "Hi there!".
bot.on("message", (ctx) => ctx.reply("Hi there!"));

bot.start();
js
const { Bot } = require("grammy");

const bot = new Bot(""); // <-- put your bot token between the "" (https://t.me/BotFather)

// Reply to any message with "Hi there!".
bot.on("message", (ctx) => ctx.reply("Hi there!"));

bot.start();
ts
import { Bot } from "https://deno.land/x/grammy@v1.34.1/mod.ts";

const bot = new Bot(""); // <-- put your bot token between the "" (https://t.me/BotFather)

// Reply to any message with "Hi there!".
bot.on("message", (ctx) => ctx.reply("Hi there!"));

bot.start();

Works! 🎉


contributor's identiconHth4nh

Thank you, Thành Hoàng Trần, for being a contributor to grammY.

© 2021-2025 · grammY supports Telegram Bot API 8.2 which was released on January 1, 2025. (Last highlight: Chat and User Verification)