Skip to content

Resources


interaction

Interaction dataclass

Bases: BaseResource


              flowchart TD
              scurrypy.resources.interaction.Interaction[Interaction]
              scurrypy.resources.base_resource.BaseResource[BaseResource]

                              scurrypy.resources.base_resource.BaseResource --> scurrypy.resources.interaction.Interaction
                


              click scurrypy.resources.interaction.Interaction href "" "scurrypy.resources.interaction.Interaction"
              click scurrypy.resources.base_resource.BaseResource href "" "scurrypy.resources.base_resource.BaseResource"
            

Represents a Discord interaction resource.

id: Snowflake instance-attribute

ID of the interaction.

token: str instance-attribute

Continuation token for responding to the interaction.

respond async

Create a message in response to an interaction. Fires Interaction Create and Message Create.

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.

  • suppress_embeds (bool, default: False ) –

    whether to suppress embeds. Defaults to False.

  • suppress_notifications (bool, default: False ) –

    whether to suppress notifications. Defaults to False.

  • is_voice_message (bool, default: False ) –

    whether this message is a voice message. Defaults to False.

  • is_components_v2 (bool, default: False ) –

    whether V2 components are in this message. Defaults to False.

  • ephemeral (bool, default: False ) –

    whether the response is only visible to the invoking user. Defaults to False.

Returns:

  • JsonQuery | None –

    interaction callback object (if with_response is toggled) else None

update async

Edits the initial Interaction response.

Parameters:

  • options (EditMessageParams) –

    fields to edit for the message

  • suppress_embeds (bool, default: False ) –

    whether to suppress embeds. Defaults to False.

  • is_components_v2 (bool, default: False ) –

    whether V2 components are in this message. Defaults to False.

respond_modal async

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

Parameters:

respond_autocomplete async

Autocomplete a command in response to an interaction. Fires Interaction Create.

Parameters:

defer_respond async

Defer creating a message in response to an interaction. Fires Interaction Create.

Parameters:

  • ephemeral (bool, default: None ) –

    whether thinking + deferred interaction response is ephemeral

defer_update async

Defer updating a message in response to an interaction. Fires Interaction Create.

followup async

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

Important

Apps are limited to 5 followup messages PER interaction.

Parameters:

  • application_id (Snowflake) –

    ID of the application

  • message (str | MessagePart) –

    content as a string or MessagePart

  • ephemeral ((optional, bool), default: False ) –

    whether the followup should be ephemeral. Defaults to False.

  • suppress_embeds ((optional, bool), default: False ) –

    whether the followup's embeds should be removed. Defaults to False.

  • suppress_notifications (bool, default: False ) –

    whether to suppress notifications. Defaults to False.

  • is_components_v2 (bool, default: False ) –

    whether V2 components are in this message. Defaults to False.

edit_original async

Edits the initial Interaction response.

Note

Existing message flags are not automatically preserved. Flags are reset unless explicitly specified.

Parameters:

  • application_id (Snowflake) –

    bot's user ID

  • options (EditMessageParams) –

    fields to edit

  • suppress_embeds (bool, default: False ) –

    whether to suppress embeds. Defaults to False.

  • is_components_v2 (bool, default: False ) –

    whether V2 components are in this message. Defaults to False.