From a27e73dd898117493f58a9b2f62ba79e1ad02ddd Mon Sep 17 00:00:00 2001 From: bucolucas Date: Tue, 20 Aug 2024 13:12:54 -0500 Subject: [PATCH] Add check for .doreboot file to send reboot complete message and delete the file. --- telegram_helper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telegram_helper.py b/telegram_helper.py index 99f4d7e..61d523c 100644 --- a/telegram_helper.py +++ b/telegram_helper.py @@ -80,6 +80,11 @@ class TelegramHelper: sys.exit(0) 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.add_handler(CommandHandler("start", self.start)) @@ -92,4 +97,3 @@ class TelegramHelper: logging.info("Bot is running...") application.run_polling() - \ No newline at end of file