diff options
Diffstat (limited to 'bot/exts/moderation/infraction/infractions.py')
| -rw-r--r-- | bot/exts/moderation/infraction/infractions.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py index 8abb199db..746d4e154 100644 --- a/bot/exts/moderation/infraction/infractions.py +++ b/bot/exts/moderation/infraction/infractions.py @@ -277,18 +277,10 @@ class Infractions(InfractionScheduler, commands.Cog): self.mod_log.ignore(Event.member_update, user.id) async def action() -> None: - try: - await user.add_roles(self._muted_role, reason=reason) - except discord.HTTPException as e: - if e.code == 10007: - log.info(f"User {user} ({user.id}) left from guild. Can't give Muted role.") - else: - log.warning( - f"Got response {e.code} (HTTP {e.status}) while giving muted role to {user} ({user.id})." - ) - else: - log.trace(f"Attempting to kick {user} from voice because they've been muted.") - await user.move_to(None, reason=reason) + await user.add_roles(self._muted_role, reason=reason) + + log.trace(f"Attempting to kick {user} from voice because they've been muted.") + await user.move_to(None, reason=reason) await self.apply_infraction(ctx, infraction, user, action()) |