Skip to main content

user_mention

Function user_mention 

Source
pub const fn user_mention(id: UserId) -> UserMention
Expand description

Mentions the user id: <@80351110224678912>.

Whether the user is notified depends on the message’s allowed_mentions.

discord.js counterpart: userMention.

§Examples

use djs_formatters::user_mention;
use djs_model::id::UserId;

let winner = UserId::new(80_351_110_224_678_912);
assert_eq!(format!("{} won!", user_mention(winner)), "<@80351110224678912> won!");