From f6a915b0301e0d3236502861f7cef029797faf9c Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 15 Dec 2023 10:10:22 -0500 Subject: [PATCH] fix(moderation): history now properly utilizes the epheremal config option --- moderation/moderation.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index a54a210..4ce8aaa 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -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 *