From cfb61bfc6a55694fcf6ea8bab49fe05c4c4c3faf Mon Sep 17 00:00:00 2001 From: armatik Date: Sat, 2 Sep 2023 20:11:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TelegramBot/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TelegramBot/main.py b/src/TelegramBot/main.py index 1b41589..f2952ca 100644 --- a/src/TelegramBot/main.py +++ b/src/TelegramBot/main.py @@ -311,6 +311,8 @@ async def top10(message: types.Message): top10_message = '' for user in top10: username = (cursor.execute("SELECT user_name FROM user_list WHERE user_id = ?", (user[0],)).fetchone())[0] + if username is None: + username = "Аноним" top10_message += f"{username} - {user[1]}\n" #в начале сообщения берём текст из config.ini и вставляем в него топ 10 пользователей await message.reply(