diff options
| author | 2020-10-06 00:36:13 +0100 | |
|---|---|---|
| committer | 2020-10-06 00:36:13 +0100 | |
| commit | 880b936faf83d8fa3d7489e1f9eaab89b93af1b8 (patch) | |
| tree | 2146922c876b08d20bffa0628e000eeca4400f37 | |
| parent | Add type annotation to on_member_update listener (diff) | |
Merge get and pop into one conditional
| -rw-r--r-- | bot/exts/moderation/verification.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/bot/exts/moderation/verification.py b/bot/exts/moderation/verification.py index b86a67225..d5eb61f13 100644 --- a/bot/exts/moderation/verification.py +++ b/bot/exts/moderation/verification.py @@ -559,13 +559,11 @@ class Verification(Cog): after_roles = [r.id for r in after.roles] if constants.Roles.verified not in before_roles and constants.Roles.verified in after_roles: - if await self.member_gating_cache.get(after.id): + if await self.member_gating_cache.pop(after.id): try: await safe_dm(after.send(ALTERNATE_VERIFIED_MESSAGE)) except discord.HTTPException: log.exception("DM dispatch failed on unexpected error code") - finally: - self.member_gating_cache.pop(after.id) @Cog.listener() async def on_message(self, message: discord.Message) -> None: |