Separated loader with dp, bot and storage and added app,
which we'll be executing
This commit is contained in:
23
app.py
Normal file
23
app.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from loader import bot, storage
|
||||
|
||||
|
||||
async def on_startup(dp):
|
||||
import filters
|
||||
import middlewares
|
||||
filters.setup(dp)
|
||||
middlewares.setup(dp)
|
||||
|
||||
from utils.notify_admins import on_startup_notify
|
||||
await on_startup_notify(dp)
|
||||
|
||||
|
||||
async def on_shutdown(dp):
|
||||
await bot.close()
|
||||
await storage.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from aiogram import executor
|
||||
from handlers import dp
|
||||
|
||||
executor.start_polling(dp, on_startup=on_startup)
|
||||
Reference in New Issue
Block a user