aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/main.py b/main.py
index 64aad14..0559edc 100644
--- a/main.py
+++ b/main.py
@@ -1,21 +1,26 @@
1import optparse
2
3from aiogram import executor, types as t, Dispatcher
4import logging 1import logging
5 2
3from aiogram import Dispatcher, executor
4from aiogram import types as t
5
6logging.basicConfig(level=logging.INFO) 6logging.basicConfig(level=logging.INFO)
7 7
8
8async def on_start(dp: Dispatcher): 9async def on_start(dp: Dispatcher):
9 from shared.commands import commands 10 from shared.commands import commands
11
10 for scope, cmd in commands.items(): 12 for scope, cmd in commands.items():
11 await dp.bot.delete_my_commands(scope) 13 await dp.bot.delete_my_commands(scope)
12 await dp.bot.set_my_commands(cmd, scope) 14 await dp.bot.set_my_commands(cmd, scope)
13 15
14 16
15if __name__ == '__main__': 17if __name__ == "__main__":
16 from shared.instances import dp
17 import handlers 18 import handlers
19 from shared.instances import dp
18 20
19 executor.start_polling( 21 executor.start_polling(
20 dp, allowed_updates=t.AllowedUpdates.all(), on_startup=on_start, skip_updates=True 22 dp,
23 allowed_updates=t.AllowedUpdates.all(),
24 on_startup=on_start,
25 skip_updates=True,
21 ) 26 )