#twilight #discord #discord-api #discord-bot

twilight-mention

Utilities for working with mentions in the Twilight ecosystem

27 releases (15 breaking)

0.15.3 Sep 10, 2023
0.15.1 Feb 26, 2023
0.14.0 Nov 14, 2022
0.12.1 Jul 26, 2022
0.2.0 Oct 30, 2020

#168 in Rust patterns

Download history 202/week @ 2023-08-12 356/week @ 2023-08-19 345/week @ 2023-08-26 161/week @ 2023-09-02 209/week @ 2023-09-09 117/week @ 2023-09-16 103/week @ 2023-09-23 166/week @ 2023-09-30 281/week @ 2023-10-07 177/week @ 2023-10-14 80/week @ 2023-10-21 129/week @ 2023-10-28 106/week @ 2023-11-04 144/week @ 2023-11-11 232/week @ 2023-11-18 89/week @ 2023-11-25

584 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.4–2MB
~44K SLoC