discord-interactions

discord_slash Events

This page is about events of this extension. These events can be registered to discord.py’s listener or event decorator.

on_slash_command(ctx)

Called when slash command is triggered.

Parameters

ctx (model.SlashContext) – SlashContext of the triggered command.

on_slash_command_error(ctx, ex)

Called when slash command had an exception while the command was invoked.

Parameters
  • ctx (model.SlashContext) – SlashContext of the triggered command.

  • ex (Exception) – Exception that raised.

on_component(ctx)

Called when a component is triggered.

Parameters

ctx (model.ComponentContext) – ComponentContext of the triggered component.

on_component_callback(ctx, callback)

Called when a component callback is triggered.

Parameters
  • ctx (model.ComponentContext) – ComponentContext of the triggered component.

  • callback (model.ComponentCallbackObject) – triggered ComponentCallbackObject

on_component_callback_error(ctx, ex)

Called when component callback had an exception while the callback was invoked.

Parameters
  • ctx (model.ComponentContext) – Context of the callback.

  • ex (Exception) – Exception from the command invoke.