fix(moderation): history now properly utilizes the epheremal config option

This commit is contained in:
Seaswimmer 2023-12-15 10:10:22 -05:00
parent 28bcb48abc
commit f6a915b030
Signed by untrusted user: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -920,15 +920,10 @@ class Moderation(commands.Cog):
Display infractions in a grid arrangement (does not look very good)
export: bool
Exports the server's entire moderation history to a JSON file"""
await interaction.response.defer(ephemeral=ephemeral)
permissions = self.check_permissions(interaction.client.user, ['embed_links'], interaction)
if permissions:
await interaction.followup.send(f"I do not have the `{permissions}` permission, required for this action.", ephemeral=True)
return
database = await self.connect()
cursor = database.cursor()
if ephemeral is None:
ephemeral = (await self.config.user(interaction.user).history_ephemeral()
or await self.config.guild(interaction.guild).history_ephemeral()
or False)
if pagesize is None:
if inline is True:
@ -945,10 +940,15 @@ class Moderation(commands.Cog):
or await self.config.guild(interaction.guild).history_inline()
or False)
if ephemeral is None:
ephemeral = (await self.config.user(interaction.user).history_ephemeral()
or await self.config.guild(interaction.guild).history_ephemeral()
or False)
await interaction.response.defer(ephemeral=ephemeral)
permissions = self.check_permissions(interaction.client.user, ['embed_links'], interaction)
if permissions:
await interaction.followup.send(f"I do not have the `{permissions}` permission, required for this action.", ephemeral=True)
return
database = await self.connect()
cursor = database.cursor()
if target:
query = """SELECT *