fix: name is wrong for limit

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong0618
2025-07-17 19:27:57 +08:00
parent 4595b05623
commit 5bdfe6fbad

View File

@ -131,7 +131,7 @@ class MessageStore:
rows = cursor.fetchall() rows = cursor.fetchall()
return [StatsEntry(date=row[0], message_count=row[1]) for row in rows] 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: with self.connect() as conn:
self._clean_old_messages(chat_id, conn) self._clean_old_messages(chat_id, conn)
cursor = conn.cursor() cursor = conn.cursor()
@ -145,7 +145,7 @@ class MessageStore:
GROUP BY user_id GROUP BY user_id
ORDER BY num DESC ORDER BY num DESC
LIMIT ?;""", LIMIT ?;""",
(chat_id, topk), (chat_id, limit),
) )
rows = cursor.fetchall() rows = cursor.fetchall()
return [UserStatsEntry(*row) for row in rows] return [UserStatsEntry(*row) for row in rows]