mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
add capture groups to MessageMentions and validate snowflake ranges (#1612)
* add capture groups * update patterns to valid snowflake ranges
This commit is contained in:
@@ -144,18 +144,18 @@ MessageMentions.EVERYONE_PATTERN = /@(everyone|here)/g;
|
||||
* Regular expression that globally matches user mentions like `<@81440962496172032>`
|
||||
* @type {RegExp}
|
||||
*/
|
||||
MessageMentions.USERS_PATTERN = /<@!?[0-9]+>/g;
|
||||
MessageMentions.USERS_PATTERN = /<@!?(1|\d{17,19})>/g;
|
||||
|
||||
/**
|
||||
* Regular expression that globally matches role mentions like `<@&297577916114403338>`
|
||||
* @type {RegExp}
|
||||
*/
|
||||
MessageMentions.ROLES_PATTERN = /<@&[0-9]+>/g;
|
||||
MessageMentions.ROLES_PATTERN = /<@&(\d{17,19})>/g;
|
||||
|
||||
/**
|
||||
* Regular expression that globally matches channel mentions like `<#222079895583457280>`
|
||||
* @type {RegExp}
|
||||
*/
|
||||
MessageMentions.CHANNELS_PATTERN = /<#([0-9]+)>/g;
|
||||
MessageMentions.CHANNELS_PATTERN = /<#(\d{17,19})>/g;
|
||||
|
||||
module.exports = MessageMentions;
|
||||
|
||||
Reference in New Issue
Block a user