Merge pull request #160 from bucolucas/feature/reboot-clause-handler

Enhance /reboot command to create .reboot_claude file
This commit is contained in:
2024-08-21 17:08:01 -05:00
committed by GitHub
+4
View File
@@ -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...")