Skip to content

Commit b338121

Browse files
committed
Blocked roles will no longer trigger an error during unblock
1 parent 7ac59e0 commit b338121

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s
2828
- Level permissions were not checked if command permissions were set.
2929
- Regex autotriggers were not working if term was in the middle of strings.
3030
- `?blocked` now no longers show blocks that have expired.
31+
- Blocked roles will no longer trigger an error during unblock
3132

3233
### Internal
3334

bot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,18 +673,18 @@ def check_manual_blocked_roles(self, author: discord.Member) -> bool:
673673
end_time = re.search(r"%([^%]+?)%", blocked_reason)
674674
if end_time is not None:
675675
logger.warning(
676-
r"Deprecated time message for user %s, block and unblock again to update.",
677-
author.name,
676+
r"Deprecated time message for role %s, block and unblock again to update.",
677+
r.name,
678678
)
679679

680680
if end_time is not None:
681681
after = (datetime.fromisoformat(end_time.group(1)) - now).total_seconds()
682682
if after <= 0:
683683
# No longer blocked
684-
self.blocked_users.pop(str(author.id))
685-
logger.debug("No longer blocked, user %s.", author.name)
684+
self.blocked_roles.pop(str(r.id))
685+
logger.debug("No longer blocked, role %s.", r.name)
686686
return True
687-
logger.debug("User blocked, user %s.", author.name)
687+
logger.debug("User blocked, role %s.", r.name)
688688
return False
689689

690690
return True

0 commit comments

Comments
 (0)