feat(moderation): case's ephemeral toggle will now be handled by the history_ephemeral config

This commit is contained in:
Seaswimmer 2023-12-15 10:02:54 -05:00
parent b01a2bbb21
commit 1bd0a6d23b
Signed by untrusted user: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -1139,7 +1139,7 @@ class Moderation(commands.Cog):
Choice(name="Export as File", value='file'), Choice(name="Export as File", value='file'),
Choice(name='Export as Codeblock', value='codeblock') Choice(name='Export as Codeblock', value='codeblock')
]) ])
async def case(self, interaction: discord.Interaction, case: int, ephemeral: bool = False, changes: bool = False, export: Choice[str] = None): async def case(self, interaction: discord.Interaction, case: int, ephemeral: bool = None, changes: bool = False, export: Choice[str] = None):
"""Check the details of a specific case. """Check the details of a specific case.
Parameters Parameters
@ -1157,6 +1157,11 @@ class Moderation(commands.Cog):
await interaction.response.send_message(f"I do not have the `{permissions}` permission, required for this action.", ephemeral=True) await interaction.response.send_message(f"I do not have the `{permissions}` permission, required for this action.", ephemeral=True)
return return
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 case != 0: if case != 0:
case_dict = await self.fetch_case(case, interaction.guild.id) case_dict = await self.fetch_case(case, interaction.guild.id)
if case_dict: if case_dict: