From 4074561d23de8763592fb98147775c6f153eed90 Mon Sep 17 00:00:00 2001 From: ikafly144 Date: Sat, 24 Dec 2022 05:41:48 +0900 Subject: [PATCH] Add MessageComponentInteractionDataResolved struct (#1302) --- interactions.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/interactions.go b/interactions.go index 4638261..096f742 100644 --- a/interactions.go +++ b/interactions.go @@ -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