Cancel should also cancel the message listener
This commit is contained in:
parent
2a2ad9f96e
commit
43e71c95c4
@ -16,6 +16,10 @@ from modules import custom_filters
|
|||||||
async def command_cancel(app: Client, msg: Message):
|
async def command_cancel(app: Client, msg: Message):
|
||||||
col_tmp.delete_many({"user": msg.from_user.id, "sent": False})
|
col_tmp.delete_many({"user": msg.from_user.id, "sent": False})
|
||||||
col_spoilers.delete_many({"user": msg.from_user.id, "completed": False})
|
col_spoilers.delete_many({"user": msg.from_user.id, "completed": False})
|
||||||
|
try:
|
||||||
|
await app.listen.Cancel(filters.user(msg.from_user.id))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if col_applications.find_one({"user": msg.from_user.id}) is None:
|
if col_applications.find_one({"user": msg.from_user.id}) is None:
|
||||||
await msg.reply_text(
|
await msg.reply_text(
|
||||||
locale("cancel_reapply", "message", locale=msg.from_user),
|
locale("cancel_reapply", "message", locale=msg.from_user),
|
||||||
|
@ -64,6 +64,8 @@ async def cmd_message(app: Client, msg: Message):
|
|||||||
locale("message_enter", "message", locale=msg.from_user)
|
locale("message_enter", "message", locale=msg.from_user)
|
||||||
)
|
)
|
||||||
message = await listen_message(app, msg.chat.id, timeout=None)
|
message = await listen_message(app, msg.chat.id, timeout=None)
|
||||||
|
if message.text is not None and message.text == "/cancel":
|
||||||
|
return
|
||||||
sent = await app.forward_messages(
|
sent = await app.forward_messages(
|
||||||
configGet("admin", "groups"), msg.chat.id, message.id
|
configGet("admin", "groups"), msg.chat.id, message.id
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user