[−][src]Crate twilight_mention
twilight-mention
twilight-mention
is a utility crate for the Discord twilight-rs
ecosystem to mention its model types.
With this library, you can create mentions for various types, such as users, emojis, roles, members, or channels.
Installation
Add the following to your Cargo.toml
:
[dependencies]
twilight-mention = { branch = "trunk", git = "https://github.com/twilight-rs/twilight" }
Examples
Create a mention formatter a user ID, and then format it in a message:
use twilight_mention::Mention; use twilight_model::id::UserId; let user_id = UserId(123); let message = format!("Hey there, {}!", user_id.mention());
Structs
MentionFormat | Formatter to mention a resource that implements |
Traits
Mention | Mention a resource, such as an emoji or user. |