Interaction class

Inteaction structure

An Interaction is the message that your application receives when a user uses an application command or a message component.

https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure

Annotations
  • @JsonSerializable(includeIfNull: false)

Constructors

Interaction({required String id, required String applicationId, required InteractionType type, InteractionData? data, String? guildId, String? channelId, GuildMember? member, User? user, required String token, required int version, Message? message})
Constructor
Interaction.fromJson(Map<String, dynamic> json)
From json
factory

Properties

applicationId String
id of the application this interaction is for
final
channelId String?
the channel it was sent from
final
data InteractionData?
the command data payload
final
guildId String?
the guild it was sent from
final
hashCode int
The hash code for this object.
no setterinherited
id String
id of the interaction
final
invokingUser User
Convenience method to get the invoking user
no setter
member GuildMember?
guild member data for the invoking user, including permissions
final
message Message?
for components, the message they were attached to
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String
a continuation token for responding to the interaction
final
type InteractionType
the type of interaction
final
user User?
user object for the invoking user, if invoked in a DM
final
version int
read-only property, always 1
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
To json
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited