Skip to content

Commit

Permalink
Add User to Interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonHoffman committed Mar 12, 2021
1 parent 37088ae commit ba10a00
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions interactions.go
Expand Up @@ -73,9 +73,20 @@ type Interaction struct {
Data ApplicationCommandInteractionData `json:"data"`
GuildID string `json:"guild_id"`
ChannelID string `json:"channel_id"`
Member *Member `json:"member"`
Token string `json:"token"`
Version int `json:"version"`

// The member who invoked this interaction.
// NOTE: this field is only filled when the slash command was invoked in a guild;
// if it was invoked in a DM, the `User` field will be filled instead.
// Make sure to check for `nil` before using this field.
Member *Member `json:"member"`
// The user who invoked this interaction.
// NOTE: this field is only filled when the slash command was invoked in a DM;
// if it was invoked in a guild, the `Member` field will be filled instead.
// Make sure to check for `nil` before using this field.
User *User `json:"user"`

Token string `json:"token"`
Version int `json:"version"`
}

// ApplicationCommandInteractionData contains data received in an interaction event.
Expand Down

0 comments on commit ba10a00

Please sign in to comment.