Skip to content

Commit 4688e85

Browse files
committed
case insensitive mute roles
1 parent 4c3f690 commit 4688e85

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cogs/mod.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,12 @@ async def _mute(self, ctx, target: discord.Member,
207207
await self.log(action='mute', moderator=ctx.author, target=target,
208208
duration=duration, reason=reason)
209209
mute_role = (
210-
[role for role in ctx.guild.roles if 'muted' in role.name]
211-
)[0]
210+
[role for role in ctx.guild.roles if 'muted' in role.name.lower()]
211+
)
212+
if len(mute_role) == 0:
213+
return await ctx.send(
214+
error=ctx.error('I couldnt find a mute role')
215+
)
212216
await self.execute(
213217
ctx,
214218
target.add_roles(mute_role, reason=f'{ctx.author.id}: {reason}')

0 commit comments

Comments
 (0)