diff options
| author | 2020-11-09 00:06:57 +0100 | |
|---|---|---|
| committer | 2020-11-09 00:08:31 +0100 | |
| commit | dbff099fbcf4fb582ea6a091497c017e5de38d9d (patch) | |
| tree | 3e4e03cad28294be6dc8c9176862c07367840581 | |
| parent | Voice Gate: refer to config rather than hard-coded duration (diff) | |
Voice Gate: correct HTTP delete method usage
This removes the need to fetch the Channel object. Add a trace log
to help with testing.
| -rw-r--r-- | bot/exts/moderation/voice_gate.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bot/exts/moderation/voice_gate.py b/bot/exts/moderation/voice_gate.py index 6e6f4411b..054dbed2d 100644 --- a/bot/exts/moderation/voice_gate.py +++ b/bot/exts/moderation/voice_gate.py @@ -48,8 +48,6 @@ class VoiceGate(Cog): def __init__(self, bot: Bot) -> None: self.bot = bot - # voice_verification_channel set to None so that we have a placeholder to get it later in the cog - self.voice_verification_channel = None @property def mod_log(self) -> ModLog: @@ -71,9 +69,9 @@ class VoiceGate(Cog): """ # If user has received a ping in voice_verification, delete the message if message_id := await self.redis_cache.get(ctx.author.id, NO_MSG): + log.trace(f"Removing voice gate reminder message for user: {ctx.author.id}") with suppress(discord.NotFound): - self.voice_verification_channel = self.bot.get_channel(Channels.voice_gate) - await self.bot.http.delete_message(self.voice_verification_channel, message_id) + await self.bot.http.delete_message(Channels.voice_gate, message_id) await self.redis_cache.set(ctx.author.id, NO_MSG) try: |