Skip to content

Commit

Permalink
Gateway: GuildFolderID is now a signed int because Discord
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Aug 20, 2020
1 parent 87c648a commit fd818e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gateway/ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand All @@ -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
}

0 comments on commit fd818e1

Please sign in to comment.