From 5bdfe6fbad0a65ef0befe37350d1cf851f369154 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Thu, 17 Jul 2025 19:27:57 +0800 Subject: [PATCH] fix: name is wrong for limit Signed-off-by: yihong0618 --- handlers/summary/messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/summary/messages.py b/handlers/summary/messages.py index c9e960d..27768f3 100644 --- a/handlers/summary/messages.py +++ b/handlers/summary/messages.py @@ -131,7 +131,7 @@ class MessageStore: rows = cursor.fetchall() return [StatsEntry(date=row[0], message_count=row[1]) for row in rows] - def get_user_stats(self, chat_id: int, topk: int = 10) -> list[UserStatsEntry]: + def get_user_stats(self, chat_id: int, limit: int = 10) -> list[UserStatsEntry]: with self.connect() as conn: self._clean_old_messages(chat_id, conn) cursor = conn.cursor() @@ -145,7 +145,7 @@ class MessageStore: GROUP BY user_id ORDER BY num DESC LIMIT ?;""", - (chat_id, topk), + (chat_id, limit), ) rows = cursor.fetchall() return [UserStatsEntry(*row) for row in rows]