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

Improved Emoji parser in arguments

This commit is contained in:
diamondburned (Forefront) 2020-01-23 19:54:47 -08:00
parent 97b8d4f54e
commit 8ae2378484

View file

@ -19,6 +19,28 @@ type Emoji struct {
Animated bool
}
func (e Emoji) String() string {
if !e.Custom {
return e.ID
}
return e.Name + ":" + e.ID
}
func (e Emoji) URL() string {
if e.Custom {
return ""
}
base := "https://cdn.discordapp.com/emojis/" + e.ID
if e.Animated {
return base + ".gif"
} else {
return base + ".png"
}
}
func (e *Emoji) Parse(arg string) error {
// Check if Unicode
var unicode string