#twilight #discord-api #discord-bot #ecosystem #channel #user #mention

twilight-mention

Utilities for working with mentions in the Twilight ecosystem

29 releases (16 breaking)

0.16.0 Jan 12, 2025
0.16.0-rc.1 Feb 21, 2024
0.15.3 Sep 10, 2023
0.15.1 Feb 26, 2023
0.2.0 Oct 30, 2020

#712 in Parser implementations

Download history 26/week @ 2024-10-28 17/week @ 2024-11-04 4/week @ 2024-11-11 31/week @ 2024-11-18 38/week @ 2024-11-25 52/week @ 2024-12-02 180/week @ 2024-12-09 53/week @ 2024-12-16 24/week @ 2024-12-30 129/week @ 2025-01-06 146/week @ 2025-01-13 50/week @ 2025-01-20 128/week @ 2025-01-27 625/week @ 2025-02-03 81/week @ 2025-02-10

891 downloads per month
Used in twilight

ISC license

1.5MB
33K 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.3–2MB
~42K SLoC