-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
24 lines (20 loc) · 665 Bytes
/
app.py
File metadata and controls
24 lines (20 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import middlewares, filters, handlers
import asyncio
import logging
import sys
from utils.notify_admins import on_startup_notify
from utils.set_bot_commands import set_default_commands
from loader import dp, bot
from middlewares import ThrottlingMiddleware
async def main():
await on_startup_notify()
await set_default_commands()
dp.update.middleware.register(ThrottlingMiddleware())
try:
await bot.delete_webhook(drop_pending_updates=True)
await dp.start_polling(bot)
finally:
await bot.session.close()
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
asyncio.run(main())