13 lines
351 B
Python
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
|