feat: added checks to determine if you're trying to shortmute an immune user
This commit is contained in:
parent
672e7c2936
commit
79fb4ce9ec
1 changed files with 7 additions and 1 deletions
|
@ -40,12 +40,18 @@ class Shortmute(commands.Cog):
|
||||||
"interaction": interaction
|
"interaction": interaction
|
||||||
}
|
}
|
||||||
if evidence_image and evidence_link:
|
if evidence_image and evidence_link:
|
||||||
await interaction.response.send_message(content="You've provided both the `evidence_image` and the `evidence_link` arguments! Please only use one or the other.")
|
await interaction.response.send_message(content="You've provided both the `evidence_image` and the `evidence_link` arguments! Please only use one or the other.", ephemeral=True)
|
||||||
return
|
return
|
||||||
elif evidence_link:
|
elif evidence_link:
|
||||||
evidence = evidence_link
|
evidence = evidence_link
|
||||||
elif evidence_image:
|
elif evidence_image:
|
||||||
evidence = str(evidence_image)
|
evidence = str(evidence_image)
|
||||||
|
immune_roles_list = await self.config.guild(interaction.guild).immune_roles()
|
||||||
|
for role_id in immune_roles_list:
|
||||||
|
role = interaction.guild.get_role(role_id)
|
||||||
|
if role in target.roles:
|
||||||
|
await interaction.response.send_message(content="You're trying to shortmute someone who is immune from shortmuting.", ephemeral=True)
|
||||||
|
return
|
||||||
if duration == 1 or duration == -1:
|
if duration == 1 or duration == -1:
|
||||||
readable_duration = f"{duration} minute"
|
readable_duration = f"{duration} minute"
|
||||||
passed_info.update({
|
passed_info.update({
|
||||||
|
|
Loading…
Reference in a new issue