From a1298b57e5663e96d1ced8ea3069a487ea329d2f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 10 Sep 2019 13:58:20 +0200 Subject: [PATCH] Use safe_api_calls for mm --- royalnet/commands/royalgames/mm.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/royalnet/commands/royalgames/mm.py b/royalnet/commands/royalgames/mm.py index 686bcae7..cf2dd78c 100644 --- a/royalnet/commands/royalgames/mm.py +++ b/royalnet/commands/royalgames/mm.py @@ -371,12 +371,12 @@ class MmCommand(Command): self.interface.session.add(mmevent) await asyncify(self.interface.session.commit) - message: telegram.Message = await asyncify(client.send_message, - chat_id=os.environ["MM_CHANNEL_ID"], - text=telegram_escape(self._main_text(mmevent)), - parse_mode="HTML", - disable_webpage_preview=True, - reply_markup=self._main_keyboard(mmevent)) + message: telegram.Message = await self.interface.bot.safe_api_call(client.send_message, + chat_id=os.environ["MM_CHANNEL_ID"], + text=telegram_escape(self._main_text(mmevent)), + parse_mode="HTML", + disable_webpage_preview=True, + reply_markup=self._main_keyboard(mmevent)) mmevent.message_id = message.message_id # Can't asyncify this