Errors API Reference#
- exception lightbulb.errors.ApplicationCommandCreationFailed[source]#
Exception raised when initialisation of application commands fails.
- exception lightbulb.errors.BotMissingRequiredPermission(*args: Any, perms: Permissions)[source]#
Error raised when the bot is missing one or more of the required permissions in order to be able to run the command.
- missing_perms: Permissions#
The permissions that the bot is missing.
- exception lightbulb.errors.BotOnly(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when any entity other than a bot attempts to use a command that has been restricted to being used only by bots.
- exception lightbulb.errors.CheckFailure(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when a check fails before command invocation. If another error caused this to be raised then you can access it using
CheckFailure.__cause__
, or in the case of multiple checks failing, viaCheckFailure.causes
(since version 2.2.1).
- exception lightbulb.errors.CommandAlreadyExists[source]#
Error raised when attempting to add a command to the bot but a name or alias for the command conflicts with a command that already exists.
- exception lightbulb.errors.CommandInvocationError(*args: Any, original: Exception)[source]#
Error raised when an error is encountered during command invocation. This wraps the original exception that caused it, which is accessible through
CommandInvocationError.__cause__
orCommandInvocationError.original
.
- exception lightbulb.errors.CommandIsOnCooldown(*args: Any, retry_after: float)[source]#
Error raised when a command was on cooldown when it was attempted to be invoked.
- exception lightbulb.errors.CommandNotFound(*args: Any, invoked_with: str)[source]#
Error raised when a command is attempted to be invoked but an implementation is not found. This will only be raised for prefix commands.
- exception lightbulb.errors.ConverterFailure(*args: t.Any, opt: commands.base.OptionLike, raw: str)[source]#
Error raised when option type conversion fails while prefix command arguments are being parsed.
- option: commands.base.OptionLike#
The option that could not be converted.
- exception lightbulb.errors.ExtensionAlreadyLoaded[source]#
Exception raised when an extension already loaded is attempted to be loaded.
- exception lightbulb.errors.ExtensionMissingLoad[source]#
Exception raised when an extension is attempted to be loaded but does not contain a load function
- exception lightbulb.errors.ExtensionMissingUnload[source]#
Exception raised when an extension is attempted to be unloaded but does not contain an unload function
- exception lightbulb.errors.ExtensionNotFound[source]#
Exception raised when an attempt is made to load an extension that does not exist.
- exception lightbulb.errors.ExtensionNotLoaded[source]#
Exception raised when an extension not already loaded is attempted to be unloaded.
- exception lightbulb.errors.HumanOnly(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when any entity other than a human attempts to use a command that has been restricted to being used only by humans.
- exception lightbulb.errors.InsufficientCache(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when the cache is required for an operation but either could not be accessed or did not return the required object.
- exception lightbulb.errors.LightbulbError[source]#
Base lightbulb exception class. All errors raised by lightbulb will be a subclass of this exception.
- exception lightbulb.errors.MaxConcurrencyLimitReached[source]#
Error raised when the maximum number of allowed concurrent invocations for a command has been exceeded.
- exception lightbulb.errors.MissingRequiredAttachment(*args: Any, **kwargs: Any)[source]#
Error raised when an attachment is required for the command but none were supplied with the invocation.
- exception lightbulb.errors.MissingRequiredAttachmentArgument(*args: t.Any, missing: commands.base.OptionLike)[source]#
Error raised when a prefix command expects an attachment but none were supplied with the invocation.
- missing_option: commands.base.OptionLike#
The missing attachment option from the command invocation.
- exception lightbulb.errors.MissingRequiredPermission(*args: Any, perms: Permissions)[source]#
Error raised when the member invoking a command is missing one or more of the required permissions in order to be able to run the command.
- missing_perms: Permissions#
The permissions that the member is missing.
- exception lightbulb.errors.MissingRequiredRole(*args: Any, roles: Sequence[int], mode: Callable[[Sequence[bool]], bool])[source]#
Error raised when the member invoking a command is missing one or more of the required roles.
- mode#
The mode used to check the roles, can be either
any
orall
.
- exception lightbulb.errors.NSFWChannelOnly(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when a user attempts to use a command in a non-NSFW channel that has been restricted to only being used in NSFW channels.
- exception lightbulb.errors.NotEnoughArguments(*args: t.Any, missing: t.Sequence[commands.base.OptionLike])[source]#
Error raised when a prefix command expects more options than could be parsed from the user’s input.
- missing_options: t.Sequence[commands.base.OptionLike]#
The missing options from the command invocation.
- exception lightbulb.errors.NotOwner(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when a user who is not the owner of the bot attempts to use a command that is restricted to owners only.
- exception lightbulb.errors.OnlyInDM(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when a user attempts to use a command in a guild that has been restricted to being used only in DMs.
- exception lightbulb.errors.OnlyInGuild(*args: Any, causes: Sequence[Exception] | None = None)[source]#
Error raised when a user attempts to use a command in DMs that has been restricted to being used only in guilds.