Telegram bot builder: a bot for your customers, group or channel
A Telegram bot can take orders, answer FAQs, send a daily tip or collect sign-ups without anyone opening a website. Describe what it should do and your todo.is agent writes the bot with python-telegram-bot, tests the conversation flow in its workspace and gives you the BotFather steps, the code and simple hosting options.
The prompt
- Build a Telegram bot for [WHAT IT'S FOR]. Commands: [COMMANDS]. Use inline buttons for [WHERE BUTTONS HELP]. Store [WHAT TO SAVE] in a simple SQLite file. Send new [WHAT I SHOULD BE NOTIFIED ABOUT] to my own chat ID. Use python-telegram-bot (latest version), long polling, the token from a .env file, and friendly replies in [LANGUAGE]. Test the conversation flow in your workspace, then send me a zip with the code, a README with BotFather setup (name, commands list, description) and how to keep it running.
What to change
- [WHAT IT'S FOR]: E.g. "taking cake pre-orders for my home bakery", "a quiz for my Spanish class".
- [COMMANDS]: E.g. "/start, /menu, /order, /myorders, /help".
- [WHERE BUTTONS HELP]: E.g. "choosing a cake, size and pickup day".
- [WHAT TO SAVE]: E.g. "orders with name, phone, item and pickup date".
- [WHAT I SHOULD BE NOTIFIED ABOUT]: E.g. "orders", "sign-ups", "messages the bot couldn't answer".
- [LANGUAGE]: E.g. "English", "Spanish", "English and Arabic".
Example result
- Crumb & Co. order bot (python-telegram-bot)
- How a customer orders
- • /start: "Hi! I take pre-orders for Crumb & Co. Tap Menu to begin." with a Menu button
- • Menu: buttons for Carrot cake, Lemon drizzle, Chocolate fudge, Seasonal special
- • Size: 6 inch or 8 inch
- • Pickup day: buttons for the next 5 days the bakery is open (Wed to Sat)
- • Contact: the bot asks for a name and offers Telegram's Share phone number button
- • Confirm: a summary with Confirm and Change buttons
- When confirmed, the order is saved and you get a message: "New order #27: Lemon drizzle, 8 inch, Sat 17 Oct, Maya, +44 7700 900123".
- Other commands
- • /myorders: the customer's upcoming orders
- • /help: pickup address, hours and how to cancel
- • /today (only works from your chat ID): all orders for today
- Core of bot.py
- async def menu(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
- buttons = [[InlineKeyboardButton(c, callback_data=f"cake:{c}")] for c in CAKES]
- await update.effective_message.reply_text(
- "Which cake would you like?", reply_markup=InlineKeyboardMarkup(buttons))
- Setup with BotFather
- • In Telegram, open @BotFather and send /newbot, then pick a name and a username ending in "bot"
- • Copy the token into .env as TELEGRAM_TOKEN
- • Send /setcommands and paste the commands list from the README
- • Send /setdescription with the text in the README
- • Message your bot /start once, then run python get_my_id.py to save your chat ID as OWNER_ID
- Tested in the workspace
- • Full order flow, changing an order before confirming, invalid pickup days and the owner-only /today command, using a simulated update queue
- Running it
- • pip install -r requirements.txt, then python bot.py
- • Keep it online on any always-on machine (small cloud server, Raspberry Pi) with systemd; the README has the service file
- • Back up orders.db weekly
How to do it with todo.is
- Copy the prompt and describe what the bot does, its commands and what to save.
- Send it in todo.is or straight to your agent on Telegram.
- Your agent writes the bot, tests the flow and sends a zip with the code and BotFather steps.
- Create the bot with @BotFather, add the token and run it on an always-on machine.
- Ask for more features ("payments link", "Spanish menu") and get an updated zip.
Tips for a better result
- Buttons beat typing. Inline keyboards cut mistakes in dates, sizes and names.
- Keep your token in .env, never in the code you share. Use /revoke in BotFather if it leaks.
- Bots can't message people first: a customer must press Start before the bot can reply or notify them.
- Use long polling for a simple setup; webhooks need a public HTTPS address.
- If you just want reminders or a daily brief in your own Telegram, your todo.is agent can send them with a recurring to-do, no bot needed.
Telegram bot builder: FAQ
- Is making a Telegram bot free? Yes. Creating a bot with BotFather and using the Bot API is free. You only pay for the machine that runs your code, if any.
- Where does the bot run? On a computer or server you choose, which must be online for the bot to answer. todo.is writes and tests the code but doesn't host it.
- Can a Telegram bot take payments? Telegram supports payments through providers and its own options in some regions. A simpler start is a button linking to a payment page you already use.
- Can the bot work in groups? Yes. Add it to the group and decide in BotFather whether it reads all messages (privacy mode off) or only commands addressed to it (privacy mode on, the default).
JavaScript is required to use the todo.is app.