1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 11:34:18 +00:00

Use safe_api_calls for mm

This commit is contained in:
Steffo 2019-09-10 13:58:20 +02:00
parent 20e0a86fb7
commit a1298b57e5

View file

@ -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