From 0c006432d8a3dae44fe58610b8a917dffc9b7b1a Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 6 Oct 2023 13:27:54 -0400 Subject: [PATCH] fix(moderation): moderations are now sorted in descending order by ID in history command --- moderation/moderation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 9ef752d..23a2d59 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -451,7 +451,10 @@ class Moderation(commands.Cog): database = await self.connect() cursor = database.cursor() if target: - query = "SELECT * FROM moderation_%s WHERE target_id = %s" + query = """SELECT * + FROM moderation_%s + WHERE target_id = %s + ORDER BY moderation_id DESC;""" cursor.execute(query, (interaction.guild.id, target.id)) results = cursor.fetchall() result_dict_list = []