bot.exts.core.error_handler#

Error handling.

Module Contents#

Classes#

CommandErrorHandler

The error handler.

Functions#

setup(→ None)

Load the ErrorHandler cog.

Attributes#

bot.exts.core.error_handler.log[source]#
bot.exts.core.error_handler.QUESTION_MARK_ICON = 'https://cdn.discordapp.com/emojis/512367613339369475.png'[source]#
class bot.exts.core.error_handler.CommandErrorHandler(bot: bot.bot.Bot)[source]#

Bases: discord.ext.commands.Cog

The error handler.

static revert_cooldown_counter(command: discord.ext.commands.Command, message: discord.Message) None[source]#

Undoes the last cooldown counter for user-error cases.

static error_embed(message: str, title: collections.abc.Iterable | str = NEGATIVE_REPLIES) discord.Embed[source]#

Build a basic embed with red colour and either a random error title or a title provided.

async on_command_error(ctx: discord.ext.commands.Context, error: discord.ext.commands.CommandError) None[source]#

Activates when a command raises an error.

async send_command_suggestion(ctx: discord.ext.commands.Context, command_name: str) None[source]#

Send user similar commands if any can be found.

async bot.exts.core.error_handler.setup(bot: bot.bot.Bot) None[source]#

Load the ErrorHandler cog.