Bot API · Guides
Make a bot in Python in 10 minutes
A complete aiogram 3 bot for Orbeo: replies to /start, formats text, shows buttons, handles presses and echoes everything else. If you have written a Telegram bot before, this is the same code with one different line.
1. Get a token
- Install Orbeo and open Settings → My bots → Create a bot.
- Pick a handle that ends with
bot, for examplehello_bot. - Copy the token — it is shown once. If you lose it, issue a new one; the old one stops working.
2. Install aiogram
pip install aiogramaiogram 3 needs Python 3.9 or newer.
3. The bot
import asyncio
from aiogram import Bot, Dispatcher, F
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
from aiogram.filters import CommandStart
from aiogram.types import Message, CallbackQuery, InlineKeyboardMarkup, InlineKeyboardButton
TOKEN = "123:yourtoken" # Orbeo: Settings -> My bots
bot = Bot(TOKEN, session=AiohttpSession(
api=TelegramAPIServer.from_base("https://orbeo.me/botapi")))
dp = Dispatcher()
@dp.message(CommandStart())
async def start(message: Message):
kb = InlineKeyboardMarkup(inline_keyboard=[[
InlineKeyboardButton(text="👍", callback_data="like"),
InlineKeyboardButton(text="Orbeo", url="https://orbeo.me"),
]])
await message.answer("<b>Hi!</b> Send me anything.", parse_mode="HTML", reply_markup=kb)
@dp.callback_query(F.data == "like")
async def like(call: CallbackQuery):
await call.answer("Thanks!")
@dp.message()
async def echo(message: Message):
await message.copy_to(message.chat.id)
asyncio.run(dp.start_polling(bot))The only Orbeo-specific part is the TelegramAPIServer.from_base("https://orbeo.me/botapi") session. Everything else is ordinary aiogram.
4. Run it
python bot.pyFind your bot in Orbeo search by its handle, send /start — you get the greeting and two buttons. The 👍 button shows a short “Thanks!” notice.
Other libraries
python-telegram-bot 21+:
app = (Application.builder().token(TOKEN)
.base_url("https://orbeo.me/botapi/bot")
.base_file_url("https://orbeo.me/botapi/file/bot").build())Telegraf (Node.js) — the trailing slash is required:
new Telegraf(TOKEN, { telegram: { apiRoot: 'https://orbeo.me/botapi/' } });
What next
- Post to a channel — see auto-posting to a channel.
- Run without polling — see webhooks.
- Already have a Telegram bot — see moving a bot from Telegram.
- All methods and limits — Bot API reference.