-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot_runner.py
More file actions
29 lines (20 loc) · 747 Bytes
/
bot_runner.py
File metadata and controls
29 lines (20 loc) · 747 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
from app.services.telegram_service import build_bot
from app.services.scheduler_service import start_scheduler
def main():
app = build_bot()
# Start scheduler AFTER bot starts
async def post_init(app):
print("Bot started successfully.")
from telegram import BotCommand
commands = [
BotCommand("start", "Start the bot"),
BotCommand("register", "Register credentials"),
BotCommand("check_quiz", "Check VITOL quiz"),
BotCommand("check_lms", "Check LMS assignments"),
]
await app.bot.set_my_commands(commands)
start_scheduler()
app.post_init = post_init
app.run_polling()
if __name__ == "__main__":
main()