first
This commit is contained in:
25
main.py
Normal file
25
main.py
Normal file
@ -0,0 +1,25 @@
|
||||
"""Main entry point for the bot."""
|
||||
import threading
|
||||
from bot import create_bot
|
||||
from handlers.scheduler import setup_scheduler
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Main function to start the bot and scheduler."""
|
||||
# Create bot
|
||||
bot = create_bot()
|
||||
|
||||
# Setup scheduler
|
||||
scheduler = setup_scheduler(bot)
|
||||
|
||||
# Start scheduler in a separate thread
|
||||
scheduler_thread = threading.Thread(target=scheduler.start, daemon=True)
|
||||
scheduler_thread.start()
|
||||
|
||||
# Start bot polling
|
||||
print("Bot is starting...")
|
||||
bot.infinity_polling(none_stop=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user