From 8a0d577a3d9143157090b3e6a1c4fc56bdee336c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 21 Feb 2019 01:36:36 +0100 Subject: [PATCH] Fix ROYALNET-AE (Matchmaking timed out) --- telegrambot.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/telegrambot.py b/telegrambot.py index 4d75e331..861da6e0 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -475,14 +475,18 @@ def on_callback_query(bot: telegram.Bot, update: telegram.Update): inline_keyboard = IKMarkup([([IKButton(strings.MATCHMAKING.BUTTONS[key], callback_data=key)]) for key in strings.MATCHMAKING.BUTTONS]) else: inline_keyboard = None - try: - bot.edit_message_text(message_id=update.callback_query.message.message_id, - chat_id=config["Telegram"]["announcement_group"], - text=match.generate_text(session), - reply_markup=inline_keyboard, - parse_mode="HTML") - except BadRequest: - pass + while True: + try: + bot.edit_message_text(message_id=update.callback_query.message.message_id, + chat_id=config["Telegram"]["announcement_group"], + text=match.generate_text(session), + reply_markup=inline_keyboard, + parse_mode="HTML") + break + except BadRequest: + break + except TimedOut: + pass except Exception: try: bot.answer_callback_query(update.callback_query.id,