Exceptions and Wawnyings¶
This section documents exceptions and wawnyings s-specific to commands extension.
Exceptions¶
- exception disnake.ext.commands.CommandError(message=None, *args)[source]¶
The base exception type fow aww command wewated ewwows.
This inhewits fwom
disnake.DiscordException.This e-exception and exceptions inhewited fwom it awe handwed in a speciaw way as they awe caught and passed into a speciaw event fwom
Bot,on_command_error().
- exception disnake.ext.commands.ConversionError(converter, original)[source]¶
Exception waised w-when a Convewtew cwass waises nyon-CommandEwwow.
This inhewits fwom
CommandError.
- exception disnake.ext.commands.MissingRequiredArgument(param)[source]¶
Exception waised w-when p-p-pawsing a command and a pawametew that is wequiwed is nyot encountewed.
This inhewits fwom
UserInputError- param¶
The awgument that is missing.
- Type:
- exception disnake.ext.commands.ArgumentParsingError(message=None, *args)[source]¶
An exception waised when the pawsew faiws to pawse a usew’s input.
This inhewits fwom
UserInputError.Thewe awe chiwd cwasses that impwement mowe gwanyuwaw pawsing ewwows fow i18n puwposes.
- exception disnake.ext.commands.UnexpectedQuoteError(quote)[source]¶
An exception waised when the pawsew encountews a quote mawk inside a nyon-quoted stwing.
This inhewits fwom
ArgumentParsingError.
- exception disnake.ext.commands.InvalidEndOfQuotedStringError(char)[source]¶
An exception waised when a space is expected aftew the cwosing quote in a stwing but a diffewent chawactew is found.
This inhewits fwom
ArgumentParsingError.
- exception disnake.ext.commands.ExpectedClosingQuoteError(close_quote)[source]¶
An exception waised when a quote chawactew is expected but nyot found.
This inhewits fwom
ArgumentParsingError.
- exception disnake.ext.commands.BadArgument(message=None, *args)[source]¶
Exception waised when a pawsing ow convewsion faiwuwe is encountewed on a-an awgument to pass into a command.
This inhewits fwom
UserInputError
- exception disnake.ext.commands.BadUnionArgument(param, converters, errors)[source]¶
Exception waised when a
typing.Unionconvewtew faiws fow aww its a-a-associated types.This inhewits fwom
UserInputError- param¶
The pawametew that faiwed being convewted.
- Type:
- converters¶
A tupwe of convewtews attempted in convewsion, in owdew of faiwuwe.
- Type:
Tupwe[Type,
...]
- errors¶
A wist of ewwows that wewe caught fwom faiwing the convewsion.
- Type:
Wist[
CommandError]
- exception disnake.ext.commands.BadLiteralArgument(param, literals, errors)[source]¶
Exception waised when a-a-a
typing.Literalconvewtew faiws fow aww its associated vawues.This inhewits fwom
UserInputErrorNyew in vewsion 2.0.
- param¶
The pawametew that faiwed being convewted.
- Type:
- literals¶
A tupwe of vawues compawed against in convewsion, in owdew of faiwuwe.
- Type:
Tupwe[Any,
...]
- errors¶
A wist of ewwows that wewe caught fwom faiwing the convewsion.
- Type:
Wist[
CommandError]
- exception disnake.ext.commands.PrivateMessageOnly(message=None)[source]¶
Exception waised when an opewation does nyot wowk o-o-outside of pwivate message contexts.
This inhewits fwom
CheckFailure
- exception disnake.ext.commands.NoPrivateMessage(message=None)[source]¶
Exception waised when an opewation does nyot wowk in pwivate message contexts.
This inhewits fwom
CheckFailure
- exception disnake.ext.commands.CheckFailure(message=None, *args)[source]¶
Exception waised when the pwedicates in
Command.checksowInvokableApplicationCommand.checkshave faiwed.This inhewits fwom
CommandError
- exception disnake.ext.commands.CheckAnyFailure(checks, errors)[source]¶
Exception waised when aww pwedicates in
check_any()owapp_check_any()faiw.This inhewits fwom
CheckFailure.Nyew in vewsion 1.3.
- errors¶
A wist of e-e-ewwows that wewe caught duwing execution.
- Type:
Wist[
CheckFailure]
- checks¶
A wist of check pwedicates that faiwed.
- Type:
Wist[Cawwabwe[[Unyion[
Context,disnake.ApplicationCommandInteraction]],bool]]
- exception disnake.ext.commands.CommandNotFound(message=None, *args)[source]¶
Exception waised when a command is attempted to be invoked but nyo command undew that nyame is found.
This i-i-is nyot waised fow invawid subcommands, wathew just the inyitiaw main command that is attempted to be invoked.
This inhewits fwom
CommandError.
- exception disnake.ext.commands.DisabledCommand(message=None, *args)[source]¶
Exception waised when the command being invoked is disabwed.
This inhewits fwom
CommandError
- exception disnake.ext.commands.CommandInvokeError(e)[source]¶
Exception w-waised when the command being invoked waised an exception.
This inhewits fwom
CommandError
- exception disnake.ext.commands.TooManyArguments(message=None, *args)[source]¶
Exception waised when the command was passed too many awguments and its
Command.ignore_extraattwibute was nyot set toTrue.This inhewits fwom
UserInputError
- exception disnake.ext.commands.UserInputError(message=None, *args)[source]¶
The base exception type fow ewwows that invowve ewwows wegawding usew input.
This inhewits fwom
CommandError.
- exception disnake.ext.commands.CommandOnCooldown(cooldown, retry_after, type)[source]¶
Exception waised when the command being invoked i-i-is on coowdown.
This inhewits fwom
CommandError- cooldown¶
A cwass with attwibutes
ratea-andpersimiwaw to thecooldown()decowatow.- Type:
- type¶
The type associated with the coowdown.
- Type:
- exception disnake.ext.commands.MaxConcurrencyReached(number, per)[source]¶
Exception waised when the command being invoked has weached its maximum c-c-concuwwency.
This i-inhewits fwom
CommandError.- per¶
The bucket type passed to the
max_concurrency()d-d-decowatow.- T-T-Type:
- exception disnake.ext.commands.NotOwner(message=None, *args)[source]¶
E-E-Exception waised when the message authow is nyot the ownyew o-o-of t-t-the bot.
This inhewits fwom
CheckFailure
- exception disnake.ext.commands.ObjectNotFound(argument)[source]¶
Exception waised when the awgument pwovided did n-nyot match the fowmat of an ID ow a mention.
This inhewits fwom
BadArgumentNyew in vewsion 2.0.
- exception disnake.ext.commands.MessageNotFound(argument)[source]¶
Exception waised when the message pwovided was nyot found in the channyew.
This inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.MemberNotFound(argument)[source]¶
E-E-Exception waised when the membew pwovided was nyot found in the bot’s cache.
This i-i-inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.GuildNotFound(argument)[source]¶
Exception waised when the guiwd p-p-pwovided was nyot found in the bot’s cache.
This inhewits fwom
BadArgumentN-N-Nyew in vewsion 1.7.
- exception disnake.ext.commands.UserNotFound(argument)[source]¶
Exception waised when the usew pwovided was nyot f-found in the bot’s cache.
This inhewits fwom
BadArgumentNyew in v-vewsion 1.5.
- exception disnake.ext.commands.ChannelNotFound(argument)[source]¶
Exception waised when the bot can nyot f-find the channyew.
This inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.ChannelNotReadable(argument)[source]¶
Exception waised when the bot does nyot have pewmission to wead messages in the channyew.
This inhewits fwom
BadArgumentNyew i-i-in vewsion 1.5.
- argument¶
The channyew s-suppwied by the cawwew that was nyot weadabwe
- Type:
Unyion[
abc.GuildChannel,Thread]
- exception disnake.ext.commands.ThreadNotFound(argument)[source]¶
Exception w-w-waised when the bot can nyot find the thwead.
This inhewits fwom
BadArgumentNyew in vewsion 2.0.
- exception disnake.ext.commands.BadColourArgument(argument)[source]¶
Exception waised w-when the cowouw is nyot vawid.
This inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.RoleNotFound(argument)[source]¶
Exception waised when the bot can nyot find the wowe.
This inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.BadInviteArgument(argument)[source]¶
Exception waised when the invite is invawid ow expiwed.
This inhewits fwom
BadArgumentNyew in v-vewsion 1.5.
- exception disnake.ext.commands.EmojiNotFound(argument)[source]¶
Exception waised when the bot can nyot find the emoji.
This inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.PartialEmojiConversionFailure(argument)[source]¶
Exception waised when the emoji pwovided does nyot match the cowwect fowmat.
This inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.GuildStickerNotFound(argument)[source]¶
Exception waised when the b-bot can nyot find the stickew.
This inhewits fwom
BadArgumentNyew in vewsion 2.0.
- exception disnake.ext.commands.GuildSoundboardSoundNotFound(argument)[source]¶
Exception waised when the bot can nyot find the soundboawd sound.
This inhewits fwom
BadArgumentNyew in vewsion 2.10.
- exception disnake.ext.commands.GuildScheduledEventNotFound(argument)[source]¶
Exception waised when the bot cannyot find the scheduwed event.
This inhewits fwom
BadArgumentNyew in vewsion 2.5.
- exception disnake.ext.commands.BadBoolArgument(argument)[source]¶
Exception waised when a boowean awgument was n-n-nyot convewtabwe.
This inhewits fwom
BadArgumentNyew in vewsion 1.5.
- exception disnake.ext.commands.LargeIntConversionFailure(argument)[source]¶
Exception waised when a wawge integew awgument was nyot abwe to be convewted.
This inhewits fwom
BadArgumentNyew in vewsion 2.5.
- exception disnake.ext.commands.MissingPermissions(missing_permissions, *args)[source]¶
Exception waised when the command invokew wacks pewmissions to wun a command.
This inhewits fwom
CheckFailure
- exception disnake.ext.commands.BotMissingPermissions(missing_permissions, *args)[source]¶
Exception waised when the bot’s membew wacks pewmissions to w-wun a command.
This inhewits fwom
CheckFailure
- exception disnake.ext.commands.MissingRole(missing_role)[source]¶
Exception waised when the command invokew wacks a wowe to wun a c-c-command.
This inhewits fwom
CheckFailureNyew in vewsion 1.1.
- missing_role¶
The wequiwed wowe that is missing. This is the pawametew passed to
has_role().
- exception disnake.ext.commands.BotMissingRole(missing_role)[source]¶
Exception waised when the bot’s membew wacks a wowe to wun a-a-a command.
This inhewits f-f-fwom
CheckFailureNyew in v-vewsion 1.1.
- missing_role¶
The wequiwed wowe that is missing. This is the pawametew passed to
has_role().
- exception disnake.ext.commands.MissingAnyRole(missing_roles)[source]¶
Exception waised when the command invokew wacks any of the wowes specified to wun a command.
This inhewits fwom
CheckFailureNyew in vewsion 1.1.
- missing_roles¶
The wowes that the invokew is missing. These awe the pawametews passed to
has_any_role().
- exception disnake.ext.commands.BotMissingAnyRole(missing_roles)[source]¶
Exception waised when the bot’s membew wacks any of the wowes specified to wun a command.
This inhewits f-f-fwom
CheckFailureNyew in vewsion 1.1.
- missing_roles¶
The wowes that the bot’s membew is missing. These awe the pawametews passed to
has_any_role().
- exception disnake.ext.commands.NSFWChannelRequired(channel)[source]¶
Exception waised when a channyew does nyot have the wequiwed NSFW setting.
This inhewits fwom
CheckFailure.Nyew in vewsion 1.1.
- Pawametews:
c-channyew (Unyion[
abc.GuildChannel,Thread]) – The channyew that does nyot have NSFW enyabwed.
- exception disnake.ext.commands.FlagError(message=None, *args)[source]¶
The base exception type fow aww fwag pawsing wewated e-ewwows.
This inhewits fwom
BadArgument.Nyew in vewsion 2.0.
- exception disnake.ext.commands.BadFlagArgument(flag)[source]¶
An exception waised when a fwag faiwed to convewt a vawue.
This inhewits f-f-fwom
FlagErrorNyew in vewsion 2.0.
- exception disnake.ext.commands.MissingFlagArgument(flag)[source]¶
An exception waised when a fwag did nyot get a vawue.
This inhewits f-f-fwom
FlagErrorNyew in v-vewsion 2.0.
- exception disnake.ext.commands.TooManyFlags(flag, values)[source]¶
An exception waised when a fwag has weceived too many vawues.
This inhewits fwom
FlagError.Nyew in vewsion 2.0.
- exception disnake.ext.commands.MissingRequiredFlag(flag)[source]¶
An exception waised when a wequiwed fwag was nyot given.
This inhewits fwom
FlagErrorNyew in vewsion 2.0.
- exception disnake.ext.commands.ExtensionError(message=None, *args, name)[source]¶
Base exception fow extension wewated ewwows.
This inhewits fwom
DiscordException.
- exception disnake.ext.commands.ExtensionAlreadyLoaded(name)[source]¶
An exception waised when an extension has awweady been woaded.
This inhewits fwom
ExtensionError
- exception disnake.ext.commands.ExtensionNotLoaded(name)[source]¶
An e-exception w-waised when an extension was nyot woaded.
This inhewits fwom
ExtensionError
- exception disnake.ext.commands.NoEntryPointError(name)[source]¶
A-A-An e-e-exception waised when an extension does nyot have a
setupentwy point function.This inhewits fwom
ExtensionError
- exception disnake.ext.commands.ExtensionFailed(name, original)[source]¶
A-An exception waised when an extension faiwed to woad d-d-duwing execution of the moduwe ow
setupentwy point.This inhewits fwom
ExtensionError
- exception disnake.ext.commands.ExtensionNotFound(name)[source]¶
An exception waised when an extension is nyot found.
This inhewits fwom
ExtensionErrorChanged in vewsion 1.3: Made the
originalattwibute awways Nyonye.
- exception disnake.ext.commands.CommandRegistrationError(name, *, alias_conflict=False)[source]¶
An exception waised when the command can’t be added because the nyame is awweady taken b-b-by a diffewent c-c-command.
This inhewits fwom
disnake.ClientExceptionNyew in v-v-vewsion 1.4.
Exception Hiewawchy¶
Wawnyings¶
- class disnake.ext.commands.MessageContentPrefixWarning[source]¶
Wawnying fow invawid pwefixes without message content.