From 7221f5f730278e0fe4c1998a316422982bc53260 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 11 Jun 2020 18:47:25 +0200 Subject: [PATCH] Let's try deleting before sending messages --- royalpack/commands/matchmaking.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/royalpack/commands/matchmaking.py b/royalpack/commands/matchmaking.py index 410adb2a..5ed3785a 100644 --- a/royalpack/commands/matchmaking.py +++ b/royalpack/commands/matchmaking.py @@ -331,6 +331,10 @@ class MatchmakingCommand(rc.Command): bot.unregister_keyboard_key(f"mm{mmevent.mmid}_DELETE") bot.unregister_keyboard_key(f"mm{mmevent.mmid}_START") + await self.interface.serf.api_call(client.delete_message, + chat_id=mmevent.interface_data.chat_id, + message_id=mmevent.interface_data.message_id) + if interrupt == Interrupts.TIME_RAN_OUT or interrupt == Interrupts.MANUAL_START: await asyncify(client.send_message, chat_id=self.config["Telegram"]["main_group_id"], @@ -364,11 +368,6 @@ class MatchmakingCommand(rc.Command): parse_mode="HTML", disable_webpage_preview=True ) - - await self.interface.serf.api_call(client.delete_message, - chat_id=mmevent.interface_data.chat_id, - message_id=mmevent.interface_data.message_id) - else: raise rc.UnsupportedError() # The end!