From 05d8578a4e37ac8b6df7a084dce18db9eb8286df Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 7 Feb 2025 21:05:56 -0500 Subject: [PATCH] Order the list of richest --- kowalski.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kowalski.py b/kowalski.py index 13b0836..77ad322 100644 --- a/kowalski.py +++ b/kowalski.py @@ -107,7 +107,7 @@ def record_message(sender_id, receiver_id, message): def get_all_counts(): """Fetch all user message counts from SQLite and format them as a string.""" - cursor.execute("SELECT user_id, message_count FROM message_counts") + cursor.execute("SELECT user_id, message_count FROM message_counts order by message_count desc") rows = cursor.fetchall() if not rows: @@ -116,7 +116,7 @@ def get_all_counts(): response = "*The Richest:*\n" for user_id, count in rows: user, display = get_username(user_id) - response += f"- <@{display}> has ${count}\n" + response += f"- {display} has ${count}\n" return response