mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-30 10:43:30 +00:00
Discord: Marshalled Snowflakes are now -1 when null
This commit is contained in:
parent
55323ee753
commit
2cad0e87b6
|
@ -38,6 +38,8 @@ func ParseSnowflake(sf string) (Snowflake, error) {
|
|||
func (s *Snowflake) UnmarshalJSON(v []byte) error {
|
||||
id := strings.Trim(string(v), `"`)
|
||||
if id == "null" {
|
||||
// Use -1 for null.
|
||||
*s = -1
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue