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:
parent
c4504808a2
commit
aa07ff9a43
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue