Skip to content

Commit ac1984f

Browse files
committed
fix unknown component with type x received error
1 parent bb32bd4 commit ac1984f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

discord/component.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ func (u *UnmarshalComponent) UnmarshalJSON(data []byte) error {
226226
component = v
227227

228228
default:
229-
err = fmt.Errorf("unknown component with type %d received", cType.Type)
229+
var v UnknownComponent
230+
err = json.Unmarshal(data, &v)
231+
component = v
230232
}
231233
if err != nil {
232234
return err

0 commit comments

Comments
 (0)