Add MessageComponentInteractionDataResolved struct (#1302)

This commit is contained in:
ikafly144 2022-12-24 05:41:48 +09:00 committed by GitHub
parent 8a5201aae6
commit 4074561d23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -343,13 +343,22 @@ func (ApplicationCommandInteractionData) Type() InteractionType {
// MessageComponentInteractionData contains the data of message component interaction.
type MessageComponentInteractionData struct {
CustomID string `json:"custom_id"`
ComponentType ComponentType `json:"component_type"`
CustomID string `json:"custom_id"`
ComponentType ComponentType `json:"component_type"`
Resolved MessageComponentInteractionDataResolved `json:"resolved"`
// NOTE: Only filled when ComponentType is SelectMenuComponent (3). Otherwise is nil.
Values []string `json:"values"`
}
// MessageComponentInteractionDataResolved contains the resolved data of selected option.
type MessageComponentInteractionDataResolved struct {
Users map[string]*User `json:"users"`
Members map[string]*Member `json:"members"`
Roles map[string]*Role `json:"roles"`
Channels map[string]*Channel `json:"channels"`
}
// Type returns the type of interaction data.
func (MessageComponentInteractionData) Type() InteractionType {
return InteractionMessageComponent