fix(aurora): fixed delete_messages ban option
All checks were successful
Pylint / Pylint (3.11) (push) Successful in 47s
All checks were successful
Pylint / Pylint (3.11) (push) Successful in 47s
This commit is contained in:
parent
a96f461a63
commit
f65abc34e8
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue