Add 1.21.1 chat support (#284)
Merge this without verification. Otherwise can't be reviewed in the further updates.
This commit is contained in:
@ -58,3 +58,16 @@ func (m *Message) UnmarshalJSON(raw []byte) (err error) {
|
||||
return errors.New("unknown chat message type: '" + string(raw[0]) + "'")
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TranslateArgs) UnmarshalJSON(raw []byte) error {
|
||||
var v []Message
|
||||
err := json.Unmarshal(raw, &v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, v := range v {
|
||||
*t = append(*t, v)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user