Resources¶
interaction
¶
Interaction
dataclass
¶
Bases: BaseResource, _EditMessageMixin
flowchart TD
scurrypy.resources.interaction.Interaction[Interaction]
scurrypy.resources.base_resource.BaseResource[BaseResource]
scurrypy.resources.message._EditMessageMixin[_EditMessageMixin]
scurrypy.resources.base_resource.BaseResource --> scurrypy.resources.interaction.Interaction
scurrypy.resources.message._EditMessageMixin --> 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"
click scurrypy.resources.message._EditMessageMixin href "" "scurrypy.resources.message._EditMessageMixin"
Represents a Discord Interaction object.
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 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. -
ephemeral((optional, bool), default:None) –whether the response should be ephemeral
-
suppress_embeds((optional, bool), default:None) –whether the response's embeds should be removed
Returns:
-
InteractionCallbackModel | None–interaction callback object (if
with_responseis toggled) else None
update
async
¶
Edits the initial Interaction response.
Parameters:
-
options(EditMessageParams, default:{}) –fields to edit
-
suppress_embeds((optional, bool), default:None) –whether the response's embeds should be removed
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, default:None) –whether thinking + deferred interaction response is ephemeral
defer_update
async
¶
Defer updating a message in response to an interaction.
Fires InteractionEvent.
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(Snowflake) –ID of the application
-
message(str | MessagePart) –content as a string or MessagePart
-
ephemeral((optional, bool), default:None) –whether the followup should be ephemeral
-
suppress_embeds((optional, bool), default:None) –whether the followup's embeds should be removed
edit_original
async
¶
Edits the initial Interaction response.
Parameters:
-
application_id(Snowflake) –bot's user ID
-
options(EditMessageParams, default:{}) –fields to edit
-
suppress_embeds((optional, bool), default:None) –whether the response's embeds should be removed