Skip to main content

emoji

Function emoji 

Source
pub const fn emoji<'a>(id: EmojiId) -> Emoji<'a>
Expand description

Shows the custom emoji id: <:emoji:216154654256398347>.

Discord finds the emoji by its ID; the name only matters where the emoji cannot be shown, so it defaults to emoji. Set it with name; an animated emoji needs animated (D-213). A Unicode emoji is written as itself (🪴).

discord.js counterpart: formatEmoji.

§Examples

use djs_formatters::emoji;
use djs_model::id::EmojiId;

let id = EmojiId::new(392_938_283_556_143_104);
assert_eq!(emoji(id).to_string(), "<:emoji:392938283556143104>");
assert_eq!(emoji(id).name("b1nzy").animated(true).to_string(), "<a:b1nzy:392938283556143104>");