Skip to main content

Module mention

Module mention 

Source
Expand description

Mentions: the text that shows them (<@id>, <@&id>, @everyone) and what a message names in its mentions. Zaun names mentions explicitly: the host never reads them from the text, so a message notifies only who its Mentions list.

Constants§

EVERYONE
The text that shows @everyone.
MAX_MEMBERS
Most members one message may mention (spec §12).
MAX_ROLES
Most roles one message may mention (spec §12).

Functions§

is_id
Whether id is a well-formed Zaun id: 16 bytes in unpadded base64url (22 characters, the last one of A, Q, g, w).
member
The text that shows a member mention: <@id> (discord.js userMention).
none
No mentions.
parse
The mentions content shows: <@id> (and Discord’s <@!id>) for members, <@&id> for roles, @everyone. Each id once, in order, at most MAX_MEMBERS members and MAX_ROLES roles; malformed ids are skipped. Use it only on text the bot wrote: on text from members it would mention whoever they named.
role
The text that shows a role mention: <@&id> (discord.js roleMention).