1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-27 17:23:00 +00:00

Discord: Fixed Emoji.APIString() mishandling Unicode characters

This commit is contained in:
diamondburned (Forefront) 2020-05-14 00:49:10 -07:00
parent c4504808a2
commit aa07ff9a43
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ type Emoji struct {
// APIString returns a string usable for sending over to the API. // APIString returns a string usable for sending over to the API.
func (e Emoji) APIString() string { func (e Emoji) APIString() string {
if e.ID == 0 { if !e.ID.Valid() {
return e.Name // is unicode return e.Name // is unicode
} }

View file

@ -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 { func (s Snowflake) String() string {
if s == NullSnowflake { if !s.Valid() {
return "" return ""
} }
return strconv.FormatUint(uint64(s), 10) return strconv.FormatUint(uint64(s), 10)
} }