From dbff099fbcf4fb582ea6a091497c017e5de38d9d Mon Sep 17 00:00:00 2001 From: kwzrd Date: Mon, 9 Nov 2020 00:06:57 +0100 Subject: Voice Gate: correct HTTP delete method usage This removes the need to fetch the Channel object. Add a trace log to help with testing. --- bot/exts/moderation/voice_gate.py | 6 ++---- 1 file 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: -- cgit v1.2.3