From acee84d044c65b9a8d6ab4a164d189fa0eaa174a Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Mon, 6 Apr 2020 02:06:07 +0200 Subject: Handle dormant invokation not being found. --- bot/cogs/help_channels.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 912ce4f44..bc973cd4d 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -5,6 +5,7 @@ import logging import random import typing as t from collections import deque +from contextlib import suppress from datetime import datetime from pathlib import Path @@ -211,7 +212,9 @@ class HelpChannels(Scheduler, commands.Cog): if await self.dormant_check(ctx): self.cancel_task(ctx.channel.id) await self.move_to_dormant(ctx.channel) - await ctx.message.delete() + with suppress(discord.errors.NotFound): + await ctx.message.delete() + log.trace("Deleting dormant invokation message.") await self.reset_send_permissions_for_help_user(ctx.channel) else: log.debug(f"{ctx.author} invoked command 'dormant' outside an in-use help channel") -- cgit v1.2.3