Skip to content

discohook.interaction

Classes

Interaction

discohook.interaction.Interaction

Represents a discord interaction.

Property Index

Method Index

Properties

app_permissions

The permissions of the application Returns

Optional[int]

application_id

The id of the application that the interaction was triggered for Returns

str

author

The author of the interaction If the interaction was triggered in a guild, this will return a member object else it will return user object. Returns

Union[User, Member]

channel

The channel where the interaction was triggered Returns

PartialChannel

channel_id

The channel id of the interaction Returns

Optional[str]

context

Context where the interaction was triggered from. Returns

InteractionContextType | None

created_at

The timestamp when the interaction was created Returns

float

data

Command data payload (if the interaction is a command).

Returns

  • Type: Dict[str, Any]
    • Command data payload.

error

Error that occurred during the interaction

Returns

  • Type: Exception | None
    • Exception object.

from_originator

Whether the interaction was triggered by the same user who triggered the message Returns

bool

guild_id

The guild id of the interaction Returns

Optional[str]

guild_locale

The guild locale of the interaction Returns

Optional[str]

id

Unique id of the interaction

Returns

  • Type: str
    • Interaction id.

locale

The locale of the interaction Returns

Optional[str]

message

The message from which the component interaction was triggered Returns

Message

parsed_command_options

Resolved command options payload (if the interaction is a command).

responded

Whether the interaction has been responded to.

Returns

  • Type: bool
    • Whether the interaction has been responded to.

response

The response adapter for the interaction Returns

ResponseAdapter

token

The token of the interaction Returns

str

traceback

Traceback of the error that occurred during the interaction

Returns

  • Type: str | None
    • Traceback string.

type

The type of the interaction Returns

Optional[InteractionType]

version

The version of the interaction Returns

int

Methods

original_response

python
async original_response(self) -> discohook.message.Message | None

Gets the original response message of the interaction if the interaction has been responded to. Returns

InteractionResponse The original response message