Crate twilight_mention

source ·
Expand description

§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());

Re-exports§

Modules§

  • Formatters for creating mentions.
  • Parse mentions out of strings.
  • Timestamps with the ability to be formatted in clients based on the client’s local timezone and locale.