From 9c6f3acac1334e885cc6b9d176a4b816bb68710a Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Sat, 12 Dec 2020 04:35:37 +0100 Subject: Use send_denial util instead of creating embed manually The symbol is also no longer sent back to the user, as it is not necessary and we can skip the cleanup on it --- bot/exts/info/doc/_cog.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index 1b5eaa6d5..8c52b04cf 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -19,7 +19,7 @@ from bot.constants import MODERATION_ROLES, RedirectOutput from bot.converters import InventoryURL, PackageName, ValidURL from bot.pagination import LinePaginator from bot.utils.lock import lock -from bot.utils.messages import wait_for_deletion +from bot.utils.messages import send_denial, wait_for_deletion from bot.utils.scheduling import Scheduler from ._inventory_parser import fetch_inventory from ._parsing import get_symbol_markdown @@ -370,12 +370,7 @@ class DocCog(commands.Cog): doc_embed = await self.get_symbol_embed(symbol) if doc_embed is None: - symbol = await discord.ext.commands.clean_content().convert(ctx, symbol) - error_embed = discord.Embed( - description=f"Sorry, I could not find any documentation for `{(symbol)}`.", - colour=discord.Colour.red() - ) - error_message = await ctx.send(embed=error_embed) + 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 ctx.message.delete() -- cgit v1.2.3