27 lines
469 B
Python
27 lines
469 B
Python
import asyncio
|
|
import os
|
|
|
|
from aiogram import Bot, Dispatcher
|
|
from dotenv import load_dotenv
|
|
|
|
from bot.handlers2 import handlers_router
|
|
|
|
load_dotenv()
|
|
|
|
|
|
async def start() -> None:
|
|
bot = Bot(token=os.getenv("BOT_TOKEN"))
|
|
dp = Dispatcher()
|
|
|
|
dp.include_routers(handlers_router)
|
|
|
|
try:
|
|
await bot.delete_webhook()
|
|
await dp.start_polling(bot)
|
|
finally:
|
|
await bot.session.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(start())
|