Skip to content

Interaction Resource

Note

The following classes come from the scurrypy.resources.interaction module.


Interaction dataclass

Bases: BaseResource

Represents a Discord Interaction object.

id: int instance-attribute

ID of the interaction.

token: str instance-attribute

Continuation token for responding to the interaction.

context: Any instance-attribute

Associated user data.

respond async

Create a message in response to an interaction. Fires InteractionEvent and MessageCreateEvent.

Parameters:

  • message (str | MessagePart) –

    content as a string or MessagePart

  • with_response (bool, default: False ) –

    if the interaction data should be returned. Defaults to False.

  • flags (MessageFlagParams, default: {} ) –

    message flags to set

Returns:

update async

Update a message in response to an interaction. Fires MessageUpdateEvent.

Parameters:

respond_modal async

Create a modal in response to an interaction. Fires InteractionEvent.

Parameters:

  • modal (ModalPart) –

    modal data

respond_autocomplete async

Autocomplete a command in response to an interaction. Fires InteractionEvent.

Parameters:

  • choices (list[CommandOptionChoicePart]) –

    list of choices to autocomplete

defer_respond async

Defer creating a message in response to an interaction. Fires InteractionEvent.

Parameters:

  • ephemeral (bool) –

    whether thinking + deferred interaction response is ephemeral

defer_update async

Defer updating a message in response to an interaction. Fires InteractionEvent.

Parameters:

  • ephemeral (bool) –

    whether the deferred interaction response is ephemeral

followup async

Create a new message to respond to a deferred interaction. Fires MessageCreateEvent.

Important

Apps are limited to 5 followup messages PER interaction.

Parameters:

  • application_id (int) –

    ID of the application

  • message (str | MessagePart) –

    content as a string or MessagePart

  • flags (MessageFlagParams, default: {} ) –

    message flags to set

edit_original async

Update the original interaction response from a deferred update interaction.

Parameters:

  • application_id (int) –

    ID of the application

  • message (str | MessagePart) –

    content as a string or MessagePart