fix(moderation): handle unbans, unmutes, bans seperately in resolve command
This commit is contained in:
parent
0d180d16c4
commit
477673b384
1 changed files with 4 additions and 2 deletions
|
@ -469,14 +469,16 @@ class Moderation(commands.Cog):
|
||||||
case = self.generate_dict(result_2)
|
case = self.generate_dict(result_2)
|
||||||
if reason is None:
|
if reason is None:
|
||||||
reason = "No reason given."
|
reason = "No reason given."
|
||||||
if case['moderation_type'] in ['MUTE', 'TEMPBAN']:
|
if case['moderation_type'] in ['UNMUTE', 'UNBAN']:
|
||||||
|
await interaction.response.send_message(content="You cannot resolve this type of moderation!", ephemeral=True)
|
||||||
|
if case['moderation_type'] in ['MUTE', 'TEMPBAN', 'BAN']:
|
||||||
if case['moderation_type'] == 'MUTE':
|
if case['moderation_type'] == 'MUTE':
|
||||||
try:
|
try:
|
||||||
member = await interaction.guild.fetch_member(case['target_id'])
|
member = await interaction.guild.fetch_member(case['target_id'])
|
||||||
await member.timeout(None, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
await member.timeout(None, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
||||||
except discord.NotFound:
|
except discord.NotFound:
|
||||||
pass
|
pass
|
||||||
if case['moderation_type'] == 'TEMPBAN':
|
if case['moderation_type'] in ['TEMPBAN', 'BAN']:
|
||||||
try:
|
try:
|
||||||
user = await interaction.client.fetch_user(case['target_id'])
|
user = await interaction.client.fetch_user(case['target_id'])
|
||||||
await interaction.guild.unban(user, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
await interaction.guild.unban(user, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
||||||
|
|
Loading…
Reference in a new issue