улучшенния в коде и исправление ошибок

This commit is contained in:
2026-02-17 12:20:03 +07:00
parent 3adb131742
commit 9cc1da14ff
2 changed files with 6 additions and 6 deletions

View File

@@ -187,7 +187,7 @@ async def stats_cmd(update: Message | CallbackQuery) -> None:
for idx, (user_id, count) in enumerate(top_spammers, 1):
bar = create_text_bar(count, max_count, length=8)
output += f"{idx}. <code>{user_id}</code> — {count} [{bar}]\n"
output += f'{idx}. <a href="tg://user?id={user_id}">{user_id}</a> — {count} [{bar}]\n'
output += "\n"
else:
@@ -365,7 +365,7 @@ async def stats_top_spammers_callback(callback: CallbackQuery) -> None:
else:
medal = f"{idx}."
output += f"{medal} <code>{user_id}</code>\n"
output += f'{medal} <a href="tg://user?id={user_id}">{user_id}</a>\n'
output += f" └─ {format_number(count)} удалений [{bar}]\n\n"
# Общая статистика
@@ -399,7 +399,7 @@ async def stats_top_spammers_callback(callback: CallbackQuery) -> None:
# ================= ТОП СЛОВ =================
@router.callback_query(F.data == "stats_top_words")
@router.callback_query(F.data == "stats:top_words")
async def stats_top_words_callback(callback: CallbackQuery) -> None:
"""Показывает топ-10 самых частых срабатываний"""
await callback.answer()
@@ -501,7 +501,7 @@ async def user_stats_cmd(message: Message) -> None:
user_spam_stats = await manager.get_spam_stats(limit=10, user_id=user_id)
output = f"👤 <b>СТАТИСТИКА ПОЛЬЗОВАТЕЛЯ</b>\n\n"
output += f"🆔 ID: <code>{user_id}</code>\n\n"
output += f'🆔 ID: <a href="tg://user?id={user_id}">{user_id}</a>\n\n'
if user_spam_count > 0:
output += f"🗑 <b>Удалено сообщений:</b> <code>{format_number(user_spam_count)}</code>\n\n"