mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-07-23 21:30:54 +00:00
Compare commits
No commits in common. "fd818e181eeabcd26bfce7a525ee5db3c10dbd01" and "3312c665156b9fad0f72cd045afaf4945ee9966c" have entirely different histories.
fd818e181e
...
3312c66515
|
@ -30,12 +30,12 @@ func ParseSnowflake(sf string) (Snowflake, error) {
|
|||
return NullSnowflake, nil
|
||||
}
|
||||
|
||||
u, err := strconv.ParseUint(sf, 10, 64)
|
||||
i, err := strconv.ParseInt(sf, 10, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return Snowflake(u), nil
|
||||
return Snowflake(i), nil
|
||||
}
|
||||
|
||||
func (s *Snowflake) UnmarshalJSON(v []byte) error {
|
||||
|
|
|
@ -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 int64
|
||||
type GuildFolderID uint64
|
||||
|
||||
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.ParseInt(body, 10, 64)
|
||||
u, err := strconv.ParseUint(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.FormatInt(int64(g), 10)), nil
|
||||
return []byte(strconv.FormatUint(uint64(g), 10)), nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue