File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -193,19 +193,18 @@ type Message struct {
193
193
LastUpdated * time.Time `json:"last_updated,omitempty"`
194
194
}
195
195
196
-
197
196
// Unmarshal is used to unmarshal a Message we received from discord
198
197
func (m * Message ) Unmarshal (data []byte ) error {
199
198
var fullM struct {
199
+ Components []UnmarshalComponent `json:"components,omitempty"`
200
200
* Message
201
- UnmarshalComponents []UnmarshalComponent `json:"components,omitempty"`
202
201
}
203
202
err := json .Unmarshal (data , & fullM )
204
203
if err != nil {
205
204
return err
206
205
}
207
206
* m = * fullM .Message
208
- for _ , component := range fullM .UnmarshalComponents {
207
+ for _ , component := range fullM .Components {
209
208
m .Components = append (m .Components , createComponent (component ))
210
209
}
211
210
return nil
@@ -218,15 +217,15 @@ func createComponent(unmarshalComponent UnmarshalComponent) Component {
218
217
for i , unmarshalC := range unmarshalComponent .Components {
219
218
components [i ] = createComponent (unmarshalC )
220
219
}
221
- return & ActionRow {
220
+ return ActionRow {
222
221
ComponentImpl : ComponentImpl {
223
222
ComponentType : ComponentTypeActionRow ,
224
223
},
225
224
Components : components ,
226
225
}
227
226
228
227
case ComponentTypeButton :
229
- return & Button {
228
+ return Button {
230
229
ComponentImpl : ComponentImpl {
231
230
ComponentType : ComponentTypeButton ,
232
231
},
You can’t perform that action at this time.
0 commit comments