fix(aurora): fixed delete_messages ban option

This commit is contained in:
Seaswimmer 2024-01-01 11:48:08 -05:00
parent a96f461a63
commit f65abc34e8
Signed by untrusted user: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -411,7 +411,7 @@ class Aurora(commands.Cog):
Choice(name='3 Days', value=259200), Choice(name='3 Days', value=259200),
Choice(name='7 Days', value=604800), Choice(name='7 Days', value=604800),
]) ])
async def ban(self, interaction: discord.Interaction, target: discord.User, reason: str, duration: str = None, delete_messages: Choice[int] = 0, silent: bool = None): async def ban(self, interaction: discord.Interaction, target: discord.User, reason: str, duration: str = None, delete_messages: Choice[int] = None, silent: bool = None):
"""Ban a user. """Ban a user.
Parameters Parameters
@ -429,6 +429,11 @@ class Aurora(commands.Cog):
if not await check_moddable(target, interaction, ['ban_members']): if not await check_moddable(target, interaction, ['ban_members']):
return return
if delete_messages is None:
delete_messages = 0
else:
delete_messages = delete_messages.value
try: try:
await interaction.guild.fetch_ban(target) await interaction.guild.fetch_ban(target)
await interaction.response.send_message(content=f"{target.mention} is already banned!", ephemeral=True) await interaction.response.send_message(content=f"{target.mention} is already banned!", ephemeral=True)