Files
redmine_tracker/bot/factory.py
2026-04-30 16:34:57 +03:00

13 lines
351 B
Python

from aiogram import Bot, Dispatcher
from aiogram.client.session.aiohttp import AiohttpSession
bot: Bot = None # type: ignore
dp: Dispatcher = None
def init_bot_and_dp(proxy_url: str, token: str):
global bot, dp
bot = Bot(token=token, session=AiohttpSession(proxy=proxy_url) if proxy_url else None)
dp = Dispatcher()
return bot, dp