-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
41 lines (32 loc) · 989 Bytes
/
bot.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from aiogram import executor
from app.config import Config
from app.filters import register_filters
from app.handlers import (
register_errors_handler,
register_handlers_common,
register_handlers_routes,
register_handlers_schedules,
register_handlers_settings,
)
from app.main import dp, on_shutdown, on_startup
from app.signals import register_signals
from app.utils.log import configure_logging
def main():
# register custom filters
register_filters(dp)
# configure logging
configure_logging(Config.LOG_CONFIG)
# register Dispatcher handlers
register_handlers_common(dp)
register_handlers_routes(dp)
register_handlers_schedules(dp)
register_handlers_settings(dp)
register_errors_handler(dp)
# register models signals
register_signals()
# start bot polling
executor.start_polling(
dp, skip_updates=True, on_startup=on_startup, on_shutdown=on_shutdown
)
if __name__ == '__main__':
main()