Errors API Reference#

exception lightbulb.errors.ApplicationCommandCreationFailed[source]#

Exception raised when initialisation of application commands fails.

exception lightbulb.errors.BotMissingRequiredPermission(*args: Any, perms: hikari.permissions.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: hikari.permissions.Permissions#

The permissions that the bot is missing.

exception lightbulb.errors.BotOnly(*args: Any, causes: Optional[Sequence[Exception]] = 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: Optional[Sequence[Exception]] = 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, via CheckFailure.causes.

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__ or CommandInvocationError.original.

original: Exception#

The exception that caused this to be raised. Also accessible through CommandInvocationError.__cause__

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.

retry_after: float#

The amount of time in seconds remaining until the cooldown expires.

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.

invoked_with: str#

The name or alias of the command that was used.

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.

raw_value: str#

The value 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: Optional[Sequence[Exception]] = 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: Optional[Sequence[Exception]] = 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: hikari.permissions.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: hikari.permissions.Permissions#

The permissions that the member is missing.

exception lightbulb.errors.MissingRequiredRole(*args: Any, causes: Optional[Sequence[Exception]] = None)[source]#

Error raised when the member invoking a command is missing one or more of the required roles.

exception lightbulb.errors.NSFWChannelOnly(*args: Any, causes: Optional[Sequence[Exception]] = 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: Optional[Sequence[Exception]] = 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: Optional[Sequence[Exception]] = 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: Optional[Sequence[Exception]] = None)[source]#

Error raised when a user attempts to use a command in DMs that has been restricted to being used only in guilds.

exception lightbulb.errors.UnsupportedResponseOperation[source]#

Exception raised when edit or delete is called on a response that cannot be edited and/or deleted (generally occurs for ephemeral responses).

exception lightbulb.errors.WebhookOnly(*args: Any, causes: Optional[Sequence[Exception]] = None)[source]#

Error raised when any entity other than a webhook attempts to use a command that has been restricted to being used only by webhooks.