diff options
| author | 2019-01-08 16:36:54 -0500 | |
|---|---|---|
| committer | 2019-01-08 16:36:54 -0500 | |
| commit | e8a5db64dc70270488a6b9a43e21470c11936878 (patch) | |
| tree | 9e35dfa89c615130d835f440b1574894b6bc644a | |
| parent | Remove list comprehension since any() works on generators (diff) | |
Switch short-circuit logic, add logging
| -rw-r--r-- | bot/cogs/events.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/events.py b/bot/cogs/events.py index b44e5871e..78878dcb9 100644 --- a/bot/cogs/events.py +++ b/bot/cogs/events.py @@ -119,7 +119,7 @@ class Events: infraction_list = await response.json() # Check for active mute infractions - if len(infraction_list) == 0: + if not infraction_list: # Short circuit return False @@ -263,6 +263,10 @@ class Events: if role in old_roles: # Check for mute roles that were not able to be removed and skip if present if role == str(Roles.muted) and not await self.has_active_mute(str(member.id)): + log.debug( + f"User {member.id} has no active mute infraction, " + "their leftover muted role will not be persisted" + ) continue new_roles.append(Object(int(role))) |