Events API Reference#

class lightbulb.events.CommandCompletionEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

The base class for all command completion events. A subclass of this event will be dispatched after command invocation completes. This will not be dispatched if any exceptions occur during invocation.

command: commands.base.Command#

The command that this event was triggered for.

context: context_.base.Context#

The context that this event was triggered for.

class lightbulb.events.CommandErrorEvent(app: app_.BotApp, exception: errors.LightbulbError, context: context_.base.Context)[source]#

The base class for all command error events. A subclass of this event will be dispatched whenever an error is encountered before or during the invocation of a command.

context: context_.base.Context#

The context that this event was triggered for.

property exc_info: t.Tuple[t.Type[errors.LightbulbError], errors.LightbulbError, t.Optional[types.TracebackType]]#

The exception triplet compatible with context managers and traceback helpers.

exception: errors.LightbulbError#

The exception that this event was triggered for.

class lightbulb.events.CommandInvocationEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

The base class for all command invocation events. A subclass of this event will be dispatched before any command is invoked.

command: commands.base.Command#

The command that this event was triggered for.

context: context_.base.Context#

The context that this event was triggered for.

class lightbulb.events.LightbulbEvent(app: app_.BotApp)[source]#

The base class for all lightbulb events. Every event dispatched by lightbulb will be an instance of a subclass of this.

app: app_.BotApp#

BotApp instance for this event.

property bot: app_.BotApp#

BotApp instance for this event. Alias for app.

class lightbulb.events.LightbulbStartedEvent(app: app_.BotApp)[source]#

Event dispatched after the application commands have been managed.

New in version 2.1.0.

class lightbulb.events.MessageCommandCompletionEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched after the invocation of a message command is completed.

class lightbulb.events.MessageCommandErrorEvent(app: app_.BotApp, exception: errors.LightbulbError, context: context_.base.Context)[source]#

Event dispatched when an error is encountered before or during the invocation of a message command.

class lightbulb.events.MessageCommandInvocationEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched before the invocation of a message command.

class lightbulb.events.PrefixCommandCompletionEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched after the invocation of a prefix command is completed.

class lightbulb.events.PrefixCommandErrorEvent(app: app_.BotApp, exception: errors.LightbulbError, context: context_.base.Context)[source]#

Event dispatched when an error is encountered before or during the invocation of a prefix command.

class lightbulb.events.PrefixCommandInvocationEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched before the invocation of a prefix command.

class lightbulb.events.SlashCommandCompletionEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched after the invocation of a slash command is completed.

class lightbulb.events.SlashCommandErrorEvent(app: app_.BotApp, exception: errors.LightbulbError, context: context_.base.Context)[source]#

Event dispatched when an error is encountered before or during the invocation of a slash command.

class lightbulb.events.SlashCommandInvocationEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched before the invocation of a slash command.

class lightbulb.events.UserCommandCompletionEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched after the invocation of a user command is completed.

class lightbulb.events.UserCommandErrorEvent(app: app_.BotApp, exception: errors.LightbulbError, context: context_.base.Context)[source]#

Event dispatched when an error is encountered before or during the invocation of a user command.

class lightbulb.events.UserCommandInvocationEvent(app: app_.BotApp, command: commands.base.Command, context: context_.base.Context)[source]#

Event dispatched before the invocation of a user command.