| name | setup |
| description | This skill should be used when the user asks to "install grammY", "create a Telegram bot", "set up my first bot", "verify grammY installation", "get a bot token", "BotFather", or needs to bootstrap a brand-new grammY project from zero to a running echo bot. |
grammY — Setup
Bootstrap a grammY Telegram bot from zero. Five steps: install runtime, get a bot token from BotFather, install the package, write a minimal bot, run it and verify in Telegram.
1. Pick a runtime
grammY runs on Node.js 18+, Deno 1.40+, or Bun 1.0+. Pick one:
- Node.js + TypeScript — most common, biggest ecosystem.
- Deno — URL imports, no
node_modules, native TypeScript.
- Bun — Node-compatible, faster cold start.
2. Get a bot token
Open @BotFather in Telegram and send /newbot. Pick a display name and a username ending in bot (e.g. my_awesome_bot). BotFather replies with an API token in the form 123456:ABC-DEF.... Treat this as a secret — put it in .env, never commit it.
3. Install grammY
npm install grammy
4. Write a minimal bot
TypeScript (Node.js)
import { Bot } from "grammy";
const bot = new Bot(process.env.BOT_TOKEN!);
bot.command("start", (ctx) => ctx.reply("Hi! I'm alive."));
bot.on("message", (ctx) => ctx.reply(`You said: ${ctx.message.text ?? "(non-text)"}`));
bot.start();
JavaScript (Node.js)
const { Bot } = require("grammy");
const bot = new Bot(process.env.BOT_TOKEN);
bot.command("start", (ctx) => ctx.reply("Hi! I'm alive."));
bot.on("message", (ctx) => ctx.reply(`You said: ${ctx.message.text ?? "(non-text)"}`));
bot.start();
Deno
import { Bot } from "https://deno.land/x/grammy/mod.ts";
const bot = new Bot(Deno.env.get("BOT_TOKEN")!);
bot.command("start", (ctx) => ctx.reply("Hi! I'm alive."));
bot.on("message", (ctx) => ctx.reply(`You said: ${ctx.message.text ?? "(non-text)"}`));
bot.start();
5. Run and verify
BOT_TOKEN=123456:ABC-DEF... npx tsx src/bot.ts
BOT_TOKEN=... bun run src/bot.ts
BOT_TOKEN=... deno run --allow-net --allow-env bot.ts
Open Telegram, find your bot by its @username, send /start. You should see "Hi! I'm alive." Send any other message — the bot echoes it back.
Verification checklist:
- Process logs
[grammY] You can stop me by pressing Ctrl+C (or similar) on startup.
/start returns the welcome string within 1–2 seconds.
- Sending an arbitrary text message produces an echo.
If any of these fail, open the troubleshoot skill.
Quick scaffold (bundled script)
This plugin ships a helper that does steps 3–4 for you:
${CLAUDE_PLUGIN_ROOT}/scripts/init-bot.sh /path/to/my-bot
cd /path/to/my-bot
cp .env.example .env
npm install
npm run dev
The script creates package.json, tsconfig.json, src/bot.ts, .env.example, and .gitignore.
What this skill does NOT cover
- Webhook deployment (use
deployment-hosting).
- Sessions, conversations, or any plugin (use
plugins-catalog, sessions, conversations).
- Telegram account automation (different concept — see the
tg-client plugin).