How to Build a Telegram Bot Without Writing Code
Telegram is one of the best platforms for AI agents. It's available everywhere, has a clean API, and users are comfortable using bots on it. The problem has always been that setting up a bot required running a server, maintaining a webhook, and writing code to handle messages.
atbot.run removes all of that. Here's how to build a Telegram bot in three steps.
Step 1: Get a bot token from @BotFather
Open Telegram and search for @BotFather. Start a chat and type /newbot. Give your bot a name and a username (it must end in "bot"). BotFather will give you an API token — it looks like 7123456789:AAF-somethinglong.
Copy this token. Treat it like a password — don't share it publicly.
Step 2: Create an agent on atbot.run
Sign in to atbot.run. Create a new agent with the name you want to call your bot. Write a system prompt that defines what your bot does.
For example, if you want a bot that summarizes news articles: "You are a concise news summarizer. When the user sends a link or pastes an article, provide a 3-bullet summary of the key points."
Step 3: Paste your token and deploy
Go to your agent's settings, scroll to "Channels," and paste your Telegram bot token. Click "+ Telegram." Then click Deploy.
Within seconds, your agent connects to Telegram via long polling — meaning it continuously listens for new messages without you needing to set up a webhook or expose any server to the internet.
Open Telegram, find your bot by username, and start chatting. You'll get intelligent, context-aware replies driven by the AI model you selected.
Tips for a great Telegram bot
- Be specific in your system prompt. "Be helpful" is vague. "Answer questions about Italian cooking, suggest recipes based on ingredients the user has on hand, and keep replies under 200 words" gives the model clear guidance.
- Use the Web Chat on atbot.run to test your system prompt before connecting Telegram — it's faster than switching back and forth.
- You can update the system prompt at any time. Changes take effect immediately without restarting the bot.