twilight-mention

Crates.iotwilight-mention
lib.rstwilight-mention
version0.16.0-rc.1
sourcesrc
created_at2020-08-30 02:56:51.558697
updated_at2024-02-21 17:36:45.813132
descriptionUtilities for working with mentions in the Twilight ecosystem.
homepagehttps://twilight.rs/chapter_1_crates/section_8_first_party/section_2_mention.html
repositoryhttps://github.com/twilight-rs/twilight.git
max_upload_size
id282543
size76,893
Erk (Erk-)

documentation

README

twilight-mention

codecov badge discord badge github badge license badge rust badge

twilight-mention is a utility crate for the Discord twilight-rs ecosystem to mention its model types and parse those mentions.

With this library, you can create mentions for various types, such as users, emojis, roles, members, or channels.

Examples

Create a mention formatter for a user ID, and then format it in a message:

use twilight_mention::Mention;
use twilight_model::id::{marker::UserMarker, Id};

let user_id = Id::<UserMarker>::new(123);
let message = format!("Hey there, {}!", user_id.mention());
Commit count: 2436

cargo fmt