-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbot.py
More file actions
30 lines (23 loc) · 683 Bytes
/
bot.py
File metadata and controls
30 lines (23 loc) · 683 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
25
26
27
28
29
30
import asyncio
from storage.config import dp, bot
from managers.reminds import remindsManager
import utils.custom_logger as cl
import admin_panel.admin.admin
import admin_panel.mailing.mailing
import handlers.start
import handlers.profile
import handlers.chat_join
async def bot_stopped():
cl.log("Bot", "critical", f"Bot has been stopped")
async def bot_started():
cl.log("Bot", "warning", f"Bot has been started")
async def main():
tasks = [
dp.start_polling(bot),
remindsManager()
]
dp.shutdown.register(bot_stopped)
dp.startup.register(bot_started)
await asyncio.gather(*tasks)
if __name__ == "__main__":
asyncio.run(main())