From b233e67a218f9c494f6404aa63d40411db012b13 Mon Sep 17 00:00:00 2001 From: Kirill Kirilenko Date: Mon, 23 Mar 2026 19:51:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B9=D1=82=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=B2=20=D1=81=D0=BB?= =?UTF-8?q?=D1=83=D1=87=D0=B0=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=BC=20=D0=B8=D0=B7=20?= =?UTF-8?q?=D1=83=D1=87=D0=B0=D1=81=D1=82=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tg/handlers/user.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tg/handlers/user.py b/tg/handlers/user.py index 677e263..4ecc999 100644 --- a/tg/handlers/user.py +++ b/tg/handlers/user.py @@ -21,8 +21,14 @@ async def format_rating(chat_id: int, top_users: List[Any], bot: Bot) -> str: result = '' i = 1 for user in top_users: - info = await bot.get_chat_member(chat_id, user['user_id']) - result += '{}. {} - {}\n'.format(i, utils.full_name(info.user.first_name, info.user.last_name), user['value']) + name: str + try: + info = await bot.get_chat_member(chat_id, user['user_id']) + name = utils.full_name(info.user.first_name, info.user.last_name) + except Exception as e: + print(f"Не удалось получить информацию об участнике (id={user['user_id']}): {e}") + name = f"id={user['user_id']}" + result += '{}. id={} - {}\n'.format(i, name, user['value']) i = i + 1 return result