Get your API key

Lesson 1 of 5

Plan your bot and create it with BotFather

What a bot can and cannot do, a one-page command plan with a Prompt Card, creating the bot in @BotFather, and treating the token like a password.

8 min Free
One step at a time, like flipping pages.

By the end of this lesson you will know what a Telegram bot can and cannot do, have a one-page plan for your bot, and have created the bot in @BotFather with its token kept safe.

You need: Telegram on your phone or laptop, and a coding agent or a notes app for the plan · Time: 8 minutes

  1. A Telegram bot is a Telegram account that is run by your code instead of a person. Customers chat with it like with a shop on WhatsApp: they type a command or tap a button, and your code decides the reply.

    Our example for the whole course is Sharma Tiffin Service in Indore. About 60 students and office workers order lunch for the next day. Today they call or WhatsApp Mrs. Sharma, and she writes every order in a notebook until 9 PM. The bot will:

    • show the menu and answer common questions (timings, delivery area, payment),
    • take tomorrow's lunch order with buttons,
    • send a daily reminder, but only to customers who said yes,
    • send every new order to Mrs. Sharma's own Telegram.

    Running a college club instead? The same pieces make a club bot: /events instead of /menu, an RSVP button instead of an order, and a reminder the day before each event.

    Three boxes in a row. The customer's Telegram app sends /menu to Telegram's Bot API, which passes it to your code on a laptop or server, which holds the bot token. Notes below: a bot never messages first, and if your code is off nobody replies.
    Every message travels customer → Telegram → your code, and the reply goes back the same way.
    Why?

    When something goes wrong later, these three boxes tell you where to look: the customer's phone, Telegram, or your code. Most problems are in box 3, and that is the box you control.