bwmarrin / discordgo

(Golang) Go bindings for Discord
BSD 3-Clause "New" or "Revised" License
5.11k stars 813 forks source link

Add `Snowflake` type, which is a string with a custom UnmarshalJSON. #1482

Open kagadar opened 10 months ago

kagadar commented 10 months ago

Fixes #1394

Change all fields which are of type snowflake in the Discord API to this new type.

The Snowflake type will unmarshal all string values (some special identifiers, such as @me are used), and any valid uint64.

NOTE: Examples are currently broken by this change, but will be fixed after discussion about the core change.