From d5b6f3d934215eceefdb9905e1b39f7c5c2a8a61 Mon Sep 17 00:00:00 2001 From: TizzySaurus <47674925+TizzySaurus@users.noreply.github.com> Date: Fri, 23 Jul 2021 16:59:39 +0100 Subject: Delete reaction if error_message not deleted. --- bot/exts/info/doc/_cog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index 2cac7c10e..c0cb4db29 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -14,7 +14,7 @@ import discord from discord.ext import commands from bot.bot import Bot -from bot.constants import MODERATION_ROLES, RedirectOutput +from bot.constants import Emojis, MODERATION_ROLES, RedirectOutput from bot.converters import Inventory, PackageName, ValidURL, allowed_strings from bot.pagination import LinePaginator from bot.utils.lock import SharedEvent, lock @@ -342,6 +342,9 @@ class DocCog(commands.Cog): error_message = await send_denial(ctx, "No documentation found for the requested symbol.") await wait_for_deletion(error_message, (ctx.author.id,), timeout=NOT_FOUND_DELETE_DELAY) + with suppress(discord.NotFound): + await message.clear_reaction(Emojis.trashcan) + if not (ctx.message.mentions or ctx.message.role_mentions): with suppress(discord.NotFound): await ctx.message.delete() -- cgit v1.2.3