discord-interactions

discord_slash.error module

exception discord_slash.error.SlashCommandError

Bases: Exception

All exceptions of this extension can be captured with this.

Note

discord.py doesn’t trigger on_command_error event. Use this extension’s on_slash_command_error.

exception discord_slash.error.RequestFailure(status: int, msg: str)

Bases: discord_slash.error.SlashCommandError

Request to Discord API has failed.

Note

Since release 1.0.8, this is only used at utils.manage_commands. http.SlashCommandRequest uses exception from discord.py such as discord.HTTPException.

Variables
  • status – Status code of failed response.

  • msg – Message of failed response.

exception discord_slash.error.IncorrectFormat

Bases: discord_slash.error.SlashCommandError

Some formats are incorrect. See Discord API DOCS for proper format.

exception discord_slash.error.DuplicateCommand(name: str)

Bases: discord_slash.error.SlashCommandError

There is a duplicate command name.

exception discord_slash.error.DuplicateCallback(message_id: int, custom_id: str, component_type: int)

Bases: discord_slash.error.SlashCommandError

There is a duplicate component callback.

exception discord_slash.error.DuplicateSlashClient

Bases: discord_slash.error.SlashCommandError

There are duplicate SlashCommand instances.

exception discord_slash.error.CheckFailure

Bases: discord_slash.error.SlashCommandError

Command check has failed.

exception discord_slash.error.IncorrectType

Bases: discord_slash.error.SlashCommandError

Type passed was incorrect

exception discord_slash.error.IncorrectGuildIDType

Bases: discord_slash.error.SlashCommandError

Guild ID type passed was incorrect

exception discord_slash.error.IncorrectCommandData

Bases: discord_slash.error.SlashCommandError

Incorrect data was passed to a slash command data object

exception discord_slash.error.AlreadyResponded

Bases: discord_slash.error.SlashCommandError

The interaction was already responded to

exception discord_slash.error.ContextMenuError

Bases: discord_slash.error.SlashCommandError

Special error given for context menu creation/callback issues.