From e629899a724769dc66fb7a78414c4de90b91906f Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Sun, 12 May 2024 23:51:19 +0800 Subject: [PATCH] fix missing return --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 99e319d..7db0970 100644 --- a/main.py +++ b/main.py @@ -173,10 +173,11 @@ async def cmd_set_template(update: Update, context: ContextTypes.DEFAULT_TYPE) - if not reply: await update.effective_message.reply_text("Please reply to a message to set as template.") return - if '[]' in reply.text_html: - context.user_data['template'] = reply.text_html - await update.effective_message.reply_text("Template set.") - await update.effective_message.reply_text("Please reply to a message with [] to set as template.") + if '[]' not in reply.text_html: + await update.effective_message.reply_text("Please reply to a message with [] to set as template.") + return + context.user_data['template'] = reply.text_html + await update.effective_message.reply_text("Template set.") @send_action(ChatAction.TYPING)