aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-12-12 04:35:37 +0100
committerGravatar Numerlor <[email protected]>2021-01-09 20:10:54 +0100
commit9c6f3acac1334e885cc6b9d176a4b816bb68710a (patch)
tree6e6418656f48951fb13209dcbb6ee89114f6be19
parentReturn the sent message (diff)
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
-rw-r--r--bot/exts/info/doc/_cog.py9
1 files 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()