Crates.io | twilight-mention |
lib.rs | twilight-mention |
version | 0.16.0-rc.1 |
source | src |
created_at | 2020-08-30 02:56:51.558697 |
updated_at | 2024-02-21 17:36:45.813132 |
description | Utilities for working with mentions in the Twilight ecosystem. |
homepage | https://twilight.rs/chapter_1_crates/section_8_first_party/section_2_mention.html |
repository | https://github.com/twilight-rs/twilight.git |
max_upload_size | |
id | 282543 |
size | 76,893 |
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.
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());