By the end of this lesson your bot will run on your laptop and answer /start, /help and common questions on your phone, with the token kept in .env and the command menu set.
You need: Node.js LTS, VS Code and a coding agent (Set up your computer), PLAN.md and the bot from lesson 1 · Time: 9 minutes
Your agent will not talk to Telegram by hand. It uses a library: ready-made code that already knows how to send and receive Telegram messages.
We recommend grammY, a library for Node.js. When we checked on 19 November 2026, version 1.46 was the latest on npm. Why this one:
- Node.js is already installed if you did the first-web-mvp setup, and it is the same JavaScript your web apps use.
- The same code can move online later. grammY runs on your laptop with long polling and on hosts like Cloudflare Workers or Deno Deploy with a webhook (lesson 4).
- Clear docs at grammy.dev, which your agent can read when it is unsure.
Already comfortable with Python? python-telegram-bot (version 22.8 on PyPI, needs Python 3.10 or newer) is a good choice too. Pick one and tell the agent; never let it mix two libraries in one bot.
Why?If you don't name the library, the agent may pick an old tutorial's library or switch halfway. Naming it once in the prompt keeps every later change in the same style.
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- Long polling: your laptop keeps asking "anything new?"
- Build it with one Prompt Card
- Run it and test it on your phone
- Stop it with Ctrl + C, and the 409 Conflict error
- Recap