#twilight

twilight-mention

Utilities for working with mentions in the Twilight ecosystem

25 releases (15 breaking)

0.15.1 Feb 26, 2023
0.15.0-rc.1 Jan 8, 2023
0.14.0 Nov 14, 2022
0.12.1 Jul 26, 2022
0.2.0 Oct 30, 2020

#10 in #twilight

Download history 35/week @ 2022-11-26 83/week @ 2022-12-03 52/week @ 2022-12-10 76/week @ 2022-12-17 33/week @ 2022-12-24 22/week @ 2022-12-31 71/week @ 2023-01-07 67/week @ 2023-01-14 88/week @ 2023-01-21 89/week @ 2023-01-28 105/week @ 2023-02-04 128/week @ 2023-02-11 117/week @ 2023-02-18 136/week @ 2023-02-25 70/week @ 2023-03-04 76/week @ 2023-03-11

419 downloads per month
Used in twilight

ISC license

1.5MB
30K SLoC

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

Dependencies

~1.9–2.6MB
~55K SLoC