From 378f21f617eea3aef4d51bbe81caed7d2f82409f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 15 Feb 2019 22:34:45 +0100 Subject: [PATCH] And again again --- telegrambot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telegrambot.py b/telegrambot.py index e461ee9f..afe1a6c8 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -435,7 +435,11 @@ def on_callback_query(bot: telegram.Bot, update: telegram.Update): match.closed = True for player in match.players: if int(player.status) >= 1: - reply_msg(bot, player.user.telegram_id, strings.MATCHMAKING.GAME_START[int(player.status)], **match.format_dict()) + try: + reply_msg(bot, player.user.telegram_id, strings.MATCHMAKING.GAME_START[int(player.status)], **match.format_dict()) + except Unauthorized: + reply_msg(bot, main_group_id, strings.TELEGRAM.ERRORS.UNAUTHORIZED_USER, + mention=player.mention()) elif update.callback_query.data == "match_cancel": if not (match.creator == user or user.telegram_id == 25167391): bot.answer_callback_query(update.callback_query.id,