fix(moderation): moderations are now sorted in descending order by ID in history command
Some checks failed
Pylint / Pylint (push) Failing after 1m14s

This commit is contained in:
Seaswimmer 2023-10-06 13:27:54 -04:00
parent 45a1edf0d0
commit 0c006432d8
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -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 = []