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:
parent
97b8d4f54e
commit
8ae2378484
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue