From 10ee5b957be03f4d1ae08011c2682e1ce8be7dc6 Mon Sep 17 00:00:00 2001 From: bucolucas Date: Wed, 21 Aug 2024 17:07:00 -0500 Subject: [PATCH] Enhance /reboot command to create .reboot_claude if requested --- telegram_helper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telegram_helper.py b/telegram_helper.py index d1758a0..40e803f 100644 --- a/telegram_helper.py +++ b/telegram_helper.py @@ -78,6 +78,10 @@ class TelegramHelper: await query.edit_message_text(text=result) async def reboot(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: + user_message = update.message.text.split() # Split the message to check for 'claude' + if len(user_message) > 1 and user_message[1].lower() == 'claude': + open('./.reboot_claude', 'w').close() # Create an empty file + if update: await update.message.reply_text("Rebooting the bot...") logging.info("Received reboot command. Exiting process...")