discord: Add Emoji.IsCustom() & IsUnicode() methods

This commit is contained in:
unknown 2021-05-21 00:14:46 +01:00 committed by diamondburned
parent 25152c85d9
commit f8195f6e87
1 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,16 @@ type Emoji struct {
Available bool `json:"available,omitempty"`
}
// IsCustom returns whether the emoji is a custom emoji.
func (e Emoji) IsCustom() bool {
return e.ID.IsValid()
}
// IsUnicode returns whether the emoji is a unicode emoji.
func (e Emoji) IsUnicode() bool {
return !e.IsCustom()
}
// CreatedAt returns a time object representing when the emoji was created.
//
// This will only work for custom emojis.