Add check for .doreboot file to send reboot complete message and delete the file.
This commit is contained in:
+5
-1
@@ -80,6 +80,11 @@ class TelegramHelper:
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if os.path.exists("./.doreboot"):
|
||||||
|
# Assuming `send_message_to_user` is a method or function available in the bot context.
|
||||||
|
await self.bot.send_message_to_user("Reboot Complete")
|
||||||
|
os.remove("./.doreboot")
|
||||||
|
|
||||||
application = Application.builder().token(self.telegram_bot_token).build()
|
application = Application.builder().token(self.telegram_bot_token).build()
|
||||||
|
|
||||||
application.add_handler(CommandHandler("start", self.start))
|
application.add_handler(CommandHandler("start", self.start))
|
||||||
@@ -92,4 +97,3 @@ class TelegramHelper:
|
|||||||
|
|
||||||
logging.info("Bot is running...")
|
logging.info("Bot is running...")
|
||||||
application.run_polling()
|
application.run_polling()
|
||||||
|
|
||||||
Reference in New Issue
Block a user