Documentation ¶
Overview ¶
Package interaction provides types for handling Discord webhook interactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data struct { // Application commands only ID discord.CommandID `json:"id"` Name string `json:"name"` Type discord.CommandType `json:"type"` Resolved ResolvedData `json:"resolved"` Options []discord.CommandInteractionOption `json:"options"` // Components only CustomID string `json:"custom_id"` ComponentType discord.ComponentType `json:"component_type"` // Select only Values []string `json:"values"` // User/message commands only TargetID discord.Snowflake `json:"target_id"` }
Data is the interaction data.
type Interaction ¶
type Interaction struct { ID discord.InteractionID `json:"id"` Token string `json:"token"` Version uint `json:"version"` ApplicationID discord.AppID `json:"application_id"` Type discord.InteractionDataType `json:"type"` Data *Data `json:"data"` GuildID discord.GuildID `json:"guild_id"` ChannelID discord.ChannelID `json:"channel_id"` Member *discord.Member `json:"member"` User *discord.User `json:"user"` Message *discord.Message `json:"message"` }
Interaction is an interaction received from Discord.
func (Interaction) GetUser ¶
func (i Interaction) GetUser() *discord.User
GetUser gets this interaction's user, if any.
func (Interaction) UserID ¶
func (i Interaction) UserID() discord.UserID
UserID returns the user ID of this interaction, if any.
type ResolvedData ¶
type ResolvedData struct { Users map[discord.UserID]discord.User `json:"users"` Members map[discord.UserID]discord.Member `json:"members"` Roles map[discord.RoleID]discord.Role `json:"roles"` Channels map[discord.ChannelID]discord.Channel `json:"channels"` Messages map[discord.MessageID]discord.Message `json:"messages"` }
ResolvedData is the resolved data for this interaction.
Click to show internal directories.
Click to hide internal directories.