aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-11-09 00:09:38 +0100
committerGravatar kwzrd <[email protected]>2020-11-09 00:09:38 +0100
commit92132af28ef97ff7837b4d1bae4115e8a95b9554 (patch)
tree5bd92db3e6534abbd60fe3c7184a35ea313ec27d
parentVoice Gate: correct HTTP delete method usage (diff)
Voice Gate: correct after-delay message delete methodology
Use a HTTP method so that we do not have to fetch the message object, the cache only gives us the ID.
-rw-r--r--bot/exts/moderation/voice_gate.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/exts/moderation/voice_gate.py b/bot/exts/moderation/voice_gate.py
index 054dbed2d..97b588e72 100644
--- a/bot/exts/moderation/voice_gate.py
+++ b/bot/exts/moderation/voice_gate.py
@@ -216,8 +216,11 @@ class VoiceGate(Cog):
await self.redis_cache.set(member.id, message.id)
await asyncio.sleep(GateConf.voice_ping_delete_delay)
- if message := await self.redis_cache.get(member.id):
- await message.delete()
+
+ if message_id := await self.redis_cache.get(member.id):
+ log.trace(f"Removing voice gate reminder message for user: {member.id}")
+ with suppress(discord.NotFound):
+ await self.bot.http.delete_message(Channels.voice_gate, message_id)
await self.redis_cache.set(member.id, NO_MSG)
async def cog_command_error(self, ctx: Context, error: Exception) -> None: