aboutsummaryrefslogtreecommitdiff
path: root/main.py
blob: 0559edcaf617cdba7c323b04a65a8cf0cc8ca21c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import logging

from aiogram import Dispatcher, executor
from aiogram import types as t

logging.basicConfig(level=logging.INFO)


async def on_start(dp: Dispatcher):
    from shared.commands import commands

    for scope, cmd in commands.items():
        await dp.bot.delete_my_commands(scope)
        await dp.bot.set_my_commands(cmd, scope)


if __name__ == "__main__":
    import handlers
    from shared.instances import dp

    executor.start_polling(
        dp,
        allowed_updates=t.AllowedUpdates.all(),
        on_startup=on_start,
        skip_updates=True,
    )