glyde/model/emoji
Two records. Emoji is the partial a button, a select option and a
reaction carry; GuildEmoji is that plus the fields only a guild’s own
emoji has.
Types
A guild’s own emoji, from Guild.emojis and GUILD_EMOJIS_UPDATE. Nothing
below emoji is ever sent on a component or a reaction.
pub type GuildEmoji {
GuildEmoji(
emoji: Emoji,
roles: List(id.Id(id.Role)),
uploader: option.Option(user.User),
require_colons: Bool,
managed: Bool,
available: Bool,
)
}
Constructors
-
GuildEmoji( emoji: Emoji, roles: List(id.Id(id.Role)), uploader: option.Option(user.User), require_colons: Bool, managed: Bool, available: Bool, )Arguments
- roles
-
The roles allowed to use it.
- uploader
-
Who uploaded it. Needs the MANAGE_GUILD_EXPRESSIONS permission.
- available
-
False when the guild lost the boosts that paid for it.
The id and the name move together. A unicode emoji is its name and has no id; a custom one is its id and may have lost its name. Discord never sends neither, which is the state this collapse removes.
pub type Kind {
Unicode(name: String)
Custom(id: id.Id(id.Emoji), name: option.Option(String))
}
Constructors
-
Unicode(name: String) -
Custom(id: id.Id(id.Emoji), name: option.Option(String))nameis null in reactions, for a custom emoji deleted since.
Values
pub fn custom(id: id.Id(id.Emoji), name: String) -> Emoji
The partial that reactions and components take. For an animated one:
Emoji(..custom(id, name), animated: True).
pub fn decoder() -> decode.Decoder(Emoji)
pub fn guild_emoji_decoder() -> decode.Decoder(GuildEmoji)
The guild fields sit beside the partial’s, not nested under a key.