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 *