misc(moderation): removed checking channels' moderations history, will add back later on if I decide to add lockdown/slowmode/etc
All checks were successful
Pylint / Pylint (push) Successful in 1m13s
All checks were successful
Pylint / Pylint (push) Successful in 1m13s
This commit is contained in:
parent
4a628cfc1d
commit
0925753404
1 changed files with 28 additions and 35 deletions
|
@ -446,7 +446,7 @@ class Moderation(commands.Cog):
|
||||||
await self.mysql_log(interaction.guild.id, interaction.user.id, 'UNBAN', target.id, 'NULL', reason)
|
await self.mysql_log(interaction.guild.id, interaction.user.id, 'UNBAN', target.id, 'NULL', reason)
|
||||||
|
|
||||||
@app_commands.command(name="history")
|
@app_commands.command(name="history")
|
||||||
async def history(self, interaction: discord.Interaction, target: discord.Member = None, moderator: discord.Member = None, channel: discord.abc.GuildChannel = None, pagesize: app_commands.Range[int, 1, 25] = 5, page: int = 1):
|
async def history(self, interaction: discord.Interaction, target: discord.Member = None, moderator: discord.Member = None, pagesize: app_commands.Range[int, 1, 25] = 5, page: int = 1):
|
||||||
"""List previous infractions."""
|
"""List previous infractions."""
|
||||||
database = await self.connect()
|
database = await self.connect()
|
||||||
cursor = database.cursor()
|
cursor = database.cursor()
|
||||||
|
@ -462,13 +462,6 @@ class Moderation(commands.Cog):
|
||||||
WHERE moderator_id = %s
|
WHERE moderator_id = %s
|
||||||
ORDER BY moderation_id DESC;"""
|
ORDER BY moderation_id DESC;"""
|
||||||
cursor.execute(query, (interaction.guild.id, moderator.id))
|
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()
|
results = cursor.fetchall()
|
||||||
result_dict_list = []
|
result_dict_list = []
|
||||||
for result in results:
|
for result in results:
|
||||||
|
|
Loading…
Reference in a new issue