Orbeo

Bot API · Rehberler

Python ile 10 dakikada bot

Orbeo için eksiksiz bir aiogram 3 botu: /start’a yanıt verir, metni biçimlendirir, butonlar gösterir, tıklamaları işler ve geri kalan her şeyi tekrarlar. Daha önce Telegram botu yazdıysanız, bu aynı kod; yalnızca bir satır farklı.

1. Token alın

  1. Orbeo’yu yükleyin ve Ayarlar → Botlarım → Bot oluştur bölümünü açın.
  2. bot ile biten bir kullanıcı adı seçin, örneğin hello_bot.
  3. Token’ı kopyalayın — yalnızca bir kez gösterilir. Kaybederseniz yenisini oluşturun; eskisi çalışmayı bırakır.

2. aiogram kurun

pip install aiogram

aiogram 3, Python 3.9 veya daha yenisini gerektirir.

3. 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))

Orbeo’ya özgü tek kısım TelegramAPIServer.from_base("https://orbeo.me/botapi") oturumudur. Geri kalan her şey sıradan aiogram.

4. Çalıştırın

python bot.py

Botunuzu Orbeo aramasında kullanıcı adıyla bulun ve /start gönderin — karşılama mesajı ve iki buton gelir. 👍 butonu kısa bir «Thanks!» bildirimi gösterir.

Diğer kütüphaneler

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) — sondaki eğik çizgi zorunludur:

new Telegraf(TOKEN, { telegram: { apiRoot: 'https://orbeo.me/botapi/' } });

Sırada ne var