Discord: Marshalled Snowflakes are now -1 when null

This commit is contained in:
diamondburned (Forefront) 2020-05-08 13:56:00 -07:00
parent 55323ee753
commit 2cad0e87b6
1 changed files with 2 additions and 0 deletions

View File

@ -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
}