#[non_exhaustive]pub struct Emoji {
pub id: EmojiId,
pub name: CompactString,
pub roles: Vec<RoleId>,
pub user: Option<Box<User>>,
pub require_colons: bool,
pub managed: bool,
pub animated: bool,
pub available: bool,
}Expand description
A custom emoji uploaded to a guild or owned by an application.
See the emoji object.
Emojis inside reactions, buttons and polls are PartialEmojis (D-056).
discord.js counterpart: GuildEmoji / ApplicationEmoji.
§Examples
use djs_model::emoji::Emoji;
let emoji: Emoji = serde_json::from_str(
r#"{"id":"41771983429993937","name":"LUL","roles":[],"require_colons":true,
"managed":false,"animated":false}"#,
)?;
assert_eq!(emoji.name, "LUL");
assert!(emoji.available, "absent `available` means usable (D-055)");Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: EmojiIdThe emoji’s ID.
name: CompactStringThe emoji’s name.
roles: Vec<RoleId>The roles allowed to use the emoji; empty means everyone. Emojis restricted to subscription roles are premium emojis.
user: Option<Box<User>>Who uploaded the emoji: for guild emojis only visible with the
MANAGE_GUILD_EXPRESSIONS
permission; for application emojis the team member or the bot.
require_colons: boolWhether the emoji must be wrapped in colons to be used.
managed: boolWhether the emoji is managed by an integration (e.g. Twitch).
animated: boolWhether the emoji is animated.
available: boolWhether the emoji can be used; false when the guild lost the Server Boosts it needs.
true when Discord omits the field (D-055).