Skip to content

Commit 46d5e81

Browse files
authored
fix: add resolved data to ModalSubmitInteraction and its data structure (#482)
1 parent 7bd477a commit 46d5e81

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

discord/interaction_modal_submit.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ type ModalSubmitInteraction struct {
2020
func (i *ModalSubmitInteraction) UnmarshalJSON(data []byte) error {
2121
var interaction struct {
2222
rawInteraction
23-
Data ModalSubmitInteractionData `json:"data"`
24-
Message *Message `json:"message,omitempty"`
25-
Resolved ResolvedData
23+
Data ModalSubmitInteractionData `json:"data"`
24+
Message *Message `json:"message,omitempty"`
2625
}
2726
if err := json.Unmarshal(data, &interaction); err != nil {
2827
return err
@@ -104,6 +103,7 @@ func (d *ModalSubmitInteractionData) UnmarshalJSON(data []byte) error {
104103
var iData struct {
105104
CustomID string `json:"custom_id"`
106105
Components []UnmarshalComponent `json:"components"`
106+
Resolved ResolvedData `json:"resolved"`
107107
}
108108

109109
if err := json.Unmarshal(data, &iData); err != nil {
@@ -117,6 +117,8 @@ func (d *ModalSubmitInteractionData) UnmarshalJSON(data []byte) error {
117117
components = append(components, containerComponent.Component.(LayoutComponent))
118118
}
119119
d.Components = components
120+
121+
d.Resolved = iData.Resolved
120122
return nil
121123
}
122124

0 commit comments

Comments
 (0)