Skip to content

Objects


Interaction


interaction

InteractionCallbackDataModel dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.interaction.InteractionCallbackDataModel[InteractionCallbackDataModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.InteractionCallbackDataModel
                


              click scurrypy.api.interactions.interaction.InteractionCallbackDataModel href "" "scurrypy.api.interactions.interaction.InteractionCallbackDataModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the interaction callback object.

id: Snowflake instance-attribute

ID of the interaction.

type: InteractionCallbackType instance-attribute

Type of interaction.

activity_instance_id: str instance-attribute

Instance ID of activity if an activity was launched or joined.

response_message_id: Snowflake instance-attribute

ID of the message created by the interaction.

response_message_loading: bool instance-attribute

If the interaction is in a loading state.

response_message_ephemeral: bool instance-attribute

If the interaction is ephemeral.

InteractionCallbackModel dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.interaction.InteractionCallbackModel[InteractionCallbackModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.InteractionCallbackModel
                


              click scurrypy.api.interactions.interaction.InteractionCallbackModel href "" "scurrypy.api.interactions.interaction.InteractionCallbackModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the interaction callback response object.

interaction: InteractionCallbackDataModel instance-attribute

The interaction object associated with the interaction response.

InteractionModel dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.interaction.InteractionModel[InteractionModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.InteractionModel
                


              click scurrypy.api.interactions.interaction.InteractionModel href "" "scurrypy.api.interactions.interaction.InteractionModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the interaction model.

type: InteractionType instance-attribute

Type of interaction.

id: Snowflake instance-attribute

ID of interaction.

token: str instance-attribute

token of interaction.

channel_id: Snowflake instance-attribute

ID of the channel where the interaction was sent.

application_id: Snowflake instance-attribute

ID of the application that owns the interaction.

app_permissions: Permissions instance-attribute

Bitwise set of permissions pertaining to the location of the interaction. [INT_LIMIT]

member: GuildMemberModel instance-attribute

Guild member invoking the interaction.

message: MessageModel | None instance-attribute

Message associated with interaction (components or modals).

guild_id: Snowflake | None instance-attribute

ID of guild the interaction was invoked (if invoked in a guild).

guild: GuildModel | None instance-attribute

Partial guild object of the guild the interaction was invoked (if invoked in a guild).

channel: ChannelModel | None instance-attribute

Partial channel object the interaction was invoked.

ApplicationCommandOptionDataModel dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.interaction.ApplicationCommandOptionDataModel[ApplicationCommandOptionDataModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.ApplicationCommandOptionDataModel
                


              click scurrypy.api.interactions.interaction.ApplicationCommandOptionDataModel href "" "scurrypy.api.interactions.interaction.ApplicationCommandOptionDataModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the response options from a slash command.

name: str instance-attribute

Name of the command option.

type: CommandOptionType instance-attribute

Type of command option.

value: str instance-attribute

Raw value from Discord as a string.

Convert based on option type
  • INTEGER/USER/CHANNEL/ROLE/ATTACHMENT: int(value)
  • NUMBER: float(value)
  • BOOLEAN: value.lower() == 'true'

otherwise the value is expected to be str

focused: bool instance-attribute

Whether this option is the currently focused option for autocomplete.

CommandDataModel dataclass

Bases: InteractionData


              flowchart TD
              scurrypy.api.interactions.interaction.CommandDataModel[CommandDataModel]
              scurrypy.bases.interaction.InteractionData[InteractionData]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.bases.interaction.InteractionData --> scurrypy.api.interactions.interaction.CommandDataModel
                                scurrypy.core.model.DataModel --> scurrypy.bases.interaction.InteractionData
                



              click scurrypy.api.interactions.interaction.CommandDataModel href "" "scurrypy.api.interactions.interaction.CommandDataModel"
              click scurrypy.bases.interaction.InteractionData href "" "scurrypy.bases.interaction.InteractionData"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents common command interaction data fields.

id: Snowflake instance-attribute

ID of the command.

name: str instance-attribute

Name of the command.

type: CommandType instance-attribute

Type of command (e.g., message, user, slash).

guild_id: Snowflake | None instance-attribute

ID of guild from which the command was invoked.

target_id: Snowflake | None instance-attribute

ID of the user or message from which the command was invoked (message/user commands only).

resolved: ResolvedDataModel | None instance-attribute

Converted users + roles + channels + attachments.

options: list[ApplicationCommandOptionDataModel] = field(default_factory=list) class-attribute instance-attribute

Options of the command (slash command only).

get_focused_value

Get the next focused value in options.

Returns:

  • str

    next focused value or an empty string if no values are focused

get_option

Get the input for a command option by name and convert it to its proper type.

Parameters:

  • option_name (str) –

    option to fetch input from

Returns:

  • int | float | bool | str | None

    converted input data of specified option

ApplicationCommandDataModel dataclass

Bases: CommandDataModel


              flowchart TD
              scurrypy.api.interactions.interaction.ApplicationCommandDataModel[ApplicationCommandDataModel]
              scurrypy.api.interactions.interaction.CommandDataModel[CommandDataModel]
              scurrypy.bases.interaction.InteractionData[InteractionData]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.api.interactions.interaction.CommandDataModel --> scurrypy.api.interactions.interaction.ApplicationCommandDataModel
                                scurrypy.bases.interaction.InteractionData --> scurrypy.api.interactions.interaction.CommandDataModel
                                scurrypy.core.model.DataModel --> scurrypy.bases.interaction.InteractionData
                




              click scurrypy.api.interactions.interaction.ApplicationCommandDataModel href "" "scurrypy.api.interactions.interaction.ApplicationCommandDataModel"
              click scurrypy.api.interactions.interaction.CommandDataModel href "" "scurrypy.api.interactions.interaction.CommandDataModel"
              click scurrypy.bases.interaction.InteractionData href "" "scurrypy.bases.interaction.InteractionData"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the response from a command.

AutocompleteApplicationCommandDataModel dataclass

Bases: CommandDataModel


              flowchart TD
              scurrypy.api.interactions.interaction.AutocompleteApplicationCommandDataModel[AutocompleteApplicationCommandDataModel]
              scurrypy.api.interactions.interaction.CommandDataModel[CommandDataModel]
              scurrypy.bases.interaction.InteractionData[InteractionData]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.api.interactions.interaction.CommandDataModel --> scurrypy.api.interactions.interaction.AutocompleteApplicationCommandDataModel
                                scurrypy.bases.interaction.InteractionData --> scurrypy.api.interactions.interaction.CommandDataModel
                                scurrypy.core.model.DataModel --> scurrypy.bases.interaction.InteractionData
                




              click scurrypy.api.interactions.interaction.AutocompleteApplicationCommandDataModel href "" "scurrypy.api.interactions.interaction.AutocompleteApplicationCommandDataModel"
              click scurrypy.api.interactions.interaction.CommandDataModel href "" "scurrypy.api.interactions.interaction.CommandDataModel"
              click scurrypy.bases.interaction.InteractionData href "" "scurrypy.bases.interaction.InteractionData"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the response from an autocomplete command.

MessageComponentDataModel dataclass

Bases: InteractionData


              flowchart TD
              scurrypy.api.interactions.interaction.MessageComponentDataModel[MessageComponentDataModel]
              scurrypy.bases.interaction.InteractionData[InteractionData]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.bases.interaction.InteractionData --> scurrypy.api.interactions.interaction.MessageComponentDataModel
                                scurrypy.core.model.DataModel --> scurrypy.bases.interaction.InteractionData
                



              click scurrypy.api.interactions.interaction.MessageComponentDataModel href "" "scurrypy.api.interactions.interaction.MessageComponentDataModel"
              click scurrypy.bases.interaction.InteractionData href "" "scurrypy.bases.interaction.InteractionData"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the select response from a select component.

custom_id: str instance-attribute

Unique ID associated with the component.

component_type: ComponentType instance-attribute

Type of component.

resolved: ResolvedDataModel | None instance-attribute

Resolved entities from selected options.

values: list[str] | None instance-attribute

Select values (if any).

ModalComponentDataModel dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.interaction.ModalComponentDataModel[ModalComponentDataModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.ModalComponentDataModel
                


              click scurrypy.api.interactions.interaction.ModalComponentDataModel href "" "scurrypy.api.interactions.interaction.ModalComponentDataModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the modal field response from a modal.

type: ComponentType instance-attribute

Type of component.

custom_id: str instance-attribute

Unique ID associated with the component.

ModalComponentInputDataModel dataclass

Bases: ModalComponentDataModel


              flowchart TD
              scurrypy.api.interactions.interaction.ModalComponentInputDataModel[ModalComponentInputDataModel]
              scurrypy.api.interactions.interaction.ModalComponentDataModel[ModalComponentDataModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.api.interactions.interaction.ModalComponentDataModel --> scurrypy.api.interactions.interaction.ModalComponentInputDataModel
                                scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.ModalComponentDataModel
                



              click scurrypy.api.interactions.interaction.ModalComponentInputDataModel href "" "scurrypy.api.interactions.interaction.ModalComponentInputDataModel"
              click scurrypy.api.interactions.interaction.ModalComponentDataModel href "" "scurrypy.api.interactions.interaction.ModalComponentDataModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents modal component variants with the value field.

value: str instance-attribute

Text input value.

Convert based on option type
  • CHECKBOX: value.lower() == 'true'

otherwise the value is expected to be str

ModalComponentSelectDataModel dataclass

Bases: ModalComponentDataModel


              flowchart TD
              scurrypy.api.interactions.interaction.ModalComponentSelectDataModel[ModalComponentSelectDataModel]
              scurrypy.api.interactions.interaction.ModalComponentDataModel[ModalComponentDataModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.api.interactions.interaction.ModalComponentDataModel --> scurrypy.api.interactions.interaction.ModalComponentSelectDataModel
                                scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.ModalComponentDataModel
                



              click scurrypy.api.interactions.interaction.ModalComponentSelectDataModel href "" "scurrypy.api.interactions.interaction.ModalComponentSelectDataModel"
              click scurrypy.api.interactions.interaction.ModalComponentDataModel href "" "scurrypy.api.interactions.interaction.ModalComponentDataModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents modal component variants with the values field.

values: list[str] instance-attribute

String select values.

ModalComponentModel dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.interaction.ModalComponentModel[ModalComponentModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.interaction.ModalComponentModel
                


              click scurrypy.api.interactions.interaction.ModalComponentModel href "" "scurrypy.api.interactions.interaction.ModalComponentModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the modal component response from a modal.

component: ModalComponentDataModel = field(init=False) class-attribute instance-attribute

Data associated with the component.

ModalDataModel dataclass

Bases: InteractionData


              flowchart TD
              scurrypy.api.interactions.interaction.ModalDataModel[ModalDataModel]
              scurrypy.bases.interaction.InteractionData[InteractionData]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.bases.interaction.InteractionData --> scurrypy.api.interactions.interaction.ModalDataModel
                                scurrypy.core.model.DataModel --> scurrypy.bases.interaction.InteractionData
                



              click scurrypy.api.interactions.interaction.ModalDataModel href "" "scurrypy.api.interactions.interaction.ModalDataModel"
              click scurrypy.bases.interaction.InteractionData href "" "scurrypy.bases.interaction.InteractionData"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the modal response from a modal.

custom_id: str instance-attribute

Unique ID associated with the modal.

resolved: ResolvedDataModel | None instance-attribute

Resolved entities from modal data.

components: list[ModalComponentModel] instance-attribute

Components on the modal.

get_modal_data

Fetch a modal field's data by its custom ID

Parameters:

  • custom_id (str) –

    custom ID of field to fetch

Raises:

Returns:

  • bool | str | list[str]

    component values (if select component) or value or bool if checkbox


modal

ModalPart dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.modal.ModalPart[ModalPart]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.modal.ModalPart
                


              click scurrypy.api.interactions.modal.ModalPart href "" "scurrypy.api.interactions.modal.ModalPart"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the Modal object.

title: str | None = None class-attribute instance-attribute

Title of the popup modal.

custom_id: str | None = None class-attribute instance-attribute

ID for the modal.

components: list[Label] | None = None class-attribute instance-attribute

1 to 5 components that make up the modal.

Resolved Data


resolved

ResolvedDataModel dataclass

Bases: DataModel


              flowchart TD
              scurrypy.api.interactions.resolved.ResolvedDataModel[ResolvedDataModel]
              scurrypy.core.model.DataModel[DataModel]

                              scurrypy.core.model.DataModel --> scurrypy.api.interactions.resolved.ResolvedDataModel
                


              click scurrypy.api.interactions.resolved.ResolvedDataModel href "" "scurrypy.api.interactions.resolved.ResolvedDataModel"
              click scurrypy.core.model.DataModel href "" "scurrypy.core.model.DataModel"
            

Represents the resolved data object.

users: dict[Snowflake, UserModel] | None instance-attribute

Map of user snowflakes to user objects.

members: dict[Snowflake, GuildMemberModel] | None instance-attribute

Map of member snowflakes to partial guild member objects.

Missing Fields

user, deaf, and mute.

roles: dict[Snowflake, GuildRoleModel] | None instance-attribute

Map of role snowflakes to role objects.

channels: dict[Snowflake, ChannelModel] | None instance-attribute

Map of channel snowflakes to partial channel objects.

messages: dict[Snowflake, MessageModel] | None instance-attribute

Map of message snowflakes to partial message objects.

attachments: dict[Snowflake, AttachmentModel] | None instance-attribute

Map of attachment snowflakes to attachment objects.