async-first
کاملاً async/await؛ چند پیام همزمان بدون بلاک شدن.
@bot.command("a")
async def a(message):
await message.answer("A")
@bot.command("b")
async def b(message):
await message.answer("B")
# messages are handled concurrently
کاملاً async، تایپشده، با API سبک aiogram ۳ — برای تلگرام، بله و روبیکا.
pip install peyk
from peyk import Bot
bot = Bot("TOKEN", platform="telegram")
@bot.command("start")
async def start(message):
await message.answer("Hello from peyk!")
bot.run()
تواناییها روی هر پلتفرم متفاوت است. ماتریس تواناییها را ببین
کاملاً async/await؛ چند پیام همزمان بدون بلاک شدن.
@bot.command("a")
async def a(message):
await message.answer("A")
@bot.command("b")
async def b(message):
await message.answer("B")
# messages are handled concurrently
یک کد، چهار پیامرسان؛ تفاوتها صریح مستند شدهاند.
Bot("TOKEN", platform="telegram")
Bot("TOKEN", platform="bale")
Bot("TOKEN", platform="rubika")
Bot("TOKEN", platform="splus")
# handlers stay the sameاگر aiogram میشناسی، ده دقیقهای شروع میکنی.
router = Router()
@router.message(Command("start"))
async def start(message): ...کاملاً تایپشده، سازگار با mypy و pyright.
مدیریت خطا و retry، با خطای مخصوص هر پلتفرم.
try:
await bot.send(...)
except PlatformError as e:
await retry(e)FSM و کیبورد یکپارچه برای همهی پلتفرمها.
راهنما، مرجع API و مثالهای آماده.
MIT؛ بدون قفل.
| aiogram | peyk |
|---|---|
from aiogram import Bot | from peyk import Bot |
Bot(token) | Bot(token, platform="…") |
from aiogram import Router | from peyk import Router |
from aiogram.filters import Command | from peyk.filters import Command |
platform= هنگام ساخت Bot مشخص میشود؛ هندلر، فیلتر و کیبورد مستقل از پلتفرم میمانند.
.raw
پیامها یکسانسازی شدهاند؛ شیء اصلی پلتفرم از .raw در دسترس است.
peyk تفاوت توانایی پلتفرمها را در نظر میگیرد و رفتار هر مورد در ماتریس تواناییها مستند شده است.