db_kyc_project/bot/routes.py

18 lines
428 B
Python
Raw Permalink Normal View History

2024-10-28 00:04:35 +03:00
from fastapi import APIRouter
from aiogram import types, Dispatcher, Bot
from create_bot import bot, token
from config import dp
bot_api_router = APIRouter(
prefix=f'/bot/wh',
)
@bot_api_router.post(f'/{token}', include_in_schema=False)
async def bot_webhook(update: dict):
telegram_update = types.Update(**update)
Dispatcher.set_current(dp)
Bot.set_current(bot)
await dp.process_update(telegram_update)