Fix doreboot file check to run after event loop starts
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
import asyncio
|
||||||
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
|
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
|
||||||
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes, CallbackQueryHandler
|
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes, CallbackQueryHandler
|
||||||
|
|
||||||
@@ -102,6 +103,6 @@ class TelegramHelper:
|
|||||||
logging.info("Bot is running...")
|
logging.info("Bot is running...")
|
||||||
|
|
||||||
# Check for .doreboot file and send message if it exists
|
# Check for .doreboot file and send message if it exists
|
||||||
application.create_task(self.check_doreboot_file(application))
|
asyncio.get_event_loop().create_task(self.check_doreboot_file(application))
|
||||||
|
|
||||||
application.run_polling()
|
application.run_polling()
|
||||||
Reference in New Issue
Block a user