diff --git a/discord/emoji.go b/discord/emoji.go index ac48cb1..9110514 100644 --- a/discord/emoji.go +++ b/discord/emoji.go @@ -18,7 +18,7 @@ type Emoji struct { // APIString returns a string usable for sending over to the API. func (e Emoji) APIString() string { - if e.ID == 0 { + if !e.ID.Valid() { return e.Name // is unicode } diff --git a/discord/snowflake.go b/discord/snowflake.go index 7ac8674..ed2098d 100644 --- a/discord/snowflake.go +++ b/discord/snowflake.go @@ -60,11 +60,11 @@ func (s Snowflake) MarshalJSON() ([]byte, error) { } } +// String returns the ID, or nothing if the snowflake isn't valid. func (s Snowflake) String() string { - if s == NullSnowflake { + if !s.Valid() { return "" } - return strconv.FormatUint(uint64(s), 10) }