new bot structure
This commit is contained in:
22
app/bot/bot.py
Normal file
22
app/bot/bot.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import asyncio
|
||||
|
||||
from aiogram import Bot, Dispatcher
|
||||
from aiogram_dialog import setup_dialogs
|
||||
|
||||
from app.bot.dialogs.flows import dialogs_router
|
||||
from app.bot.handlers.commands import commands_router
|
||||
from config.config import settings
|
||||
|
||||
bot = Bot(token=settings.bot_token)
|
||||
dp = Dispatcher()
|
||||
|
||||
|
||||
async def main():
|
||||
setup_dialogs(dp)
|
||||
dp.include_router(commands_router)
|
||||
dp.include_router(dialogs_router)
|
||||
await dp.start_polling(bot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user