diff options
| author | 2021-08-03 18:02:39 +0100 | |
|---|---|---|
| committer | 2021-08-03 18:02:39 +0100 | |
| commit | 4856f079647f2205ebdf74b15f46126f1012b6a9 (patch) | |
| tree | 0aae6b820348dc04a8c0d1a1bed020a1e5b548ab | |
| parent | Update Sentry SDK to 1.3 (diff) | |
| parent | Merge branch 'main' into mbaruh-patch-1 (diff) | |
Merge pull request #1712 from python-discord/mbaruh-patch-1
Correctly delete from cache in ModPings
| -rw-r--r-- | bot/exts/moderation/modpings.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/moderation/modpings.py b/bot/exts/moderation/modpings.py index 1ad5005de..29a5c1c8e 100644 --- a/bot/exts/moderation/modpings.py +++ b/bot/exts/moderation/modpings.py @@ -44,7 +44,7 @@ class ModPings(Cog): log.trace("Applying the moderators role to the mod team where necessary.") for mod in mod_team.members: if mod in pings_on: # Make sure that on-duty mods aren't in the cache. - if mod in pings_off: + if mod.id in pings_off: await self.pings_off_mods.delete(mod.id) continue @@ -59,6 +59,7 @@ class ModPings(Cog): """Reapply the moderator's role to the given moderator.""" log.trace(f"Re-applying role to mod with ID {mod.id}.") await mod.add_roles(self.moderators_role, reason="Pings off period expired.") + await self.pings_off_mods.delete(mod.id) @group(name='modpings', aliases=('modping',), invoke_without_command=True) @has_any_role(*MODERATION_ROLES) |