forked from cswimr/SeaCogs
fix(moderation): history now properly utilizes the epheremal config option
This commit is contained in:
parent
28bcb48abc
commit
f6a915b030
1 changed files with 13 additions and 13 deletions
|
@ -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 *
|
||||
|
|
Loading…
Reference in a new issue