From aa8e77811d60ef25cdb1c4a7f25b2c970dc5c042 Mon Sep 17 00:00:00 2001 From: profitroll Date: Sat, 8 Apr 2023 01:17:49 +0200 Subject: [PATCH] Slightly improved context --- modules/commands/message.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/commands/message.py b/modules/commands/message.py index d1ba84c..586fa6e 100644 --- a/modules/commands/message.py +++ b/modules/commands/message.py @@ -63,8 +63,12 @@ async def cmd_message(app: Client, msg: Message): await msg.reply_text( locale("message_enter", "message", locale=msg.from_user) ) - message = await listen_message(app, msg.chat.id, timeout=None) - if message.text is not None and message.text == "/cancel": + message = await listen_message(app, msg.chat.id) + if ( + message is None + or message.text is not None + and message.text == "/cancel" + ): return sent = await app.forward_messages( configGet("admin", "groups"), msg.chat.id, message.id