aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar F4zi <[email protected]>2020-02-20 22:08:08 +0200
committerGravatar F4zi <[email protected]>2020-02-20 22:08:08 +0200
commitec1ffabc926a3a6f368f024428aa57eefa925476 (patch)
treedf147bcce2ae7cc17626a1ec6276d3ac3df5188d
parentRearrange - Function naming and Docstrings (diff)
Command suggestion message reformat.
The message sent when suggesting a command is now wrapped inside an embed
-rw-r--r--bot/cogs/error_handler.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py
index a951dc712..39b868e62 100644
--- a/bot/cogs/error_handler.py
+++ b/bot/cogs/error_handler.py
@@ -2,6 +2,7 @@ import contextlib
import difflib
import logging
+from discord import Embed
from discord.ext.commands import (
BadArgument,
BotMissingPermissions,
@@ -19,7 +20,7 @@ from discord.ext.commands import Cog, Context
from bot.api import ResponseCodeError
from bot.bot import Bot
-from bot.constants import Channels
+from bot.constants import Channels, Icons
from bot.decorators import InChannelCheckFailure
log = logging.getLogger(__name__)
@@ -110,8 +111,11 @@ class ErrorHandler(Cog):
with contextlib.suppress(CommandError):
if similar_command.can_run(ctx):
misspelled_content = ctx.message.content
+ e = Embed()
+ e.set_author(name="Did you mean:", icon_url=Icons.questionmark)
+ e.description = f"{misspelled_content.replace(command_name, similar_command_name)}"
await ctx.send(
- f"Did you mean:\n**{misspelled_content.replace(command_name, similar_command_name)}**",
+ embed=e,
delete_after=7.0
)