Enhance /reboot command to create .reboot_claude if requested

This commit is contained in:
2024-08-21 17:07:00 -05:00
parent 54c47415eb
commit 10ee5b957b
+4
View File
@@ -78,6 +78,10 @@ class TelegramHelper:
await query.edit_message_text(text=result) await query.edit_message_text(text=result)
async def reboot(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: 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: if update:
await update.message.reply_text("Rebooting the bot...") await update.message.reply_text("Rebooting the bot...")
logging.info("Received reboot command. Exiting process...") logging.info("Received reboot command. Exiting process...")