diff options
author | 2024-04-16 15:00:49 +0100 | |
---|---|---|
committer | 2024-04-16 15:00:49 +0100 | |
commit | 7d84cb875553cb99342323f25d2ce155fb27c0f9 (patch) | |
tree | aefef94117dfb25b7f8855cf36243a42d9756691 | |
parent | Bump aiohttp from 3.9.3 to 3.9.4 (#3016) (diff) |
Make watched_users a dict, not a defaultdict
This prevents accidentally creating new values when accessing a key
-rw-r--r-- | bot/exts/moderation/watchchannels/_watchchannel.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/moderation/watchchannels/_watchchannel.py b/bot/exts/moderation/watchchannels/_watchchannel.py index 71600e9df..7668f4e24 100644 --- a/bot/exts/moderation/watchchannels/_watchchannel.py +++ b/bot/exts/moderation/watchchannels/_watchchannel.py @@ -62,7 +62,7 @@ class WatchChannel(metaclass=CogABCMeta): self.log = logger # Logger of the child cog for a correct name in the logs self._consume_task = None - self.watched_users = defaultdict(dict) + self.watched_users = {} self.message_queue = defaultdict(lambda: defaultdict(deque)) self.consumption_queue = {} self.retries = 5 @@ -154,7 +154,7 @@ class WatchChannel(metaclass=CogABCMeta): self.log.exception("Failed to fetch the watched users from the API", exc_info=err) return False - self.watched_users = defaultdict(dict) + self.watched_users.clear() for entry in data: user_id = entry.pop("user") |