From 4a628cfc1d98765c6ad1192a13ab705746791737 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 6 Oct 2023 13:39:51 -0400 Subject: [PATCH] feat(moderation): you are now able to check moderation history of moderators --- moderation/moderation.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index f13875f..f9e8821 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -452,10 +452,23 @@ class Moderation(commands.Cog): cursor = database.cursor() if target: query = """SELECT * - FROM moderation_%s - WHERE target_id = %s - ORDER BY moderation_id DESC;""" + FROM moderation_%s + WHERE target_id = %s + ORDER BY moderation_id DESC;""" cursor.execute(query, (interaction.guild.id, target.id)) + elif moderator: + query = """SELECT * + FROM moderation_%s + WHERE moderator_id = %s + ORDER BY moderation_id DESC;""" + cursor.execute(query, (interaction.guild.id, moderator.id)) + elif channel: + query = """SELECT * + FROM moderation_%s + WHERE target_id = %s + ORDER BY moderation_id DESC;""" + cursor.execute(query, (interaction.guild.id, channel.id)) + if target or moderator: results = cursor.fetchall() result_dict_list = [] for result in results: