1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-30 10:43:30 +00:00

Compare commits

...

2 commits

2 changed files with 5 additions and 5 deletions

View file

@ -30,12 +30,12 @@ func ParseSnowflake(sf string) (Snowflake, error) {
return NullSnowflake, nil
}
i, err := strconv.ParseInt(sf, 10, 64)
u, err := strconv.ParseUint(sf, 10, 64)
if err != nil {
return 0, err
}
return Snowflake(i), nil
return Snowflake(u), nil
}
func (s *Snowflake) UnmarshalJSON(v []byte) error {

View file

@ -120,7 +120,7 @@ type GuildFolder struct {
// GuildFolderID is possibly a snowflake. It can also be 0 (null) or a low
// number of unknown significance.
type GuildFolderID uint64
type GuildFolderID int64
func (g *GuildFolderID) UnmarshalJSON(b []byte) error {
var body = string(b)
@ -130,7 +130,7 @@ func (g *GuildFolderID) UnmarshalJSON(b []byte) error {
body = strings.Trim(body, `"`)
u, err := strconv.ParseUint(body, 10, 64)
u, err := strconv.ParseInt(body, 10, 64)
if err != nil {
return err
}
@ -144,5 +144,5 @@ func (g GuildFolderID) MarshalJSON() ([]byte, error) {
return []byte("null"), nil
}
return []byte(strconv.FormatUint(uint64(g), 10)), nil
return []byte(strconv.FormatInt(int64(g), 10)), nil
}