feat: move internal regular expressions to static properties (#5384)

This commit is contained in:
Jan
2021-04-15 00:36:35 +02:00
committed by GitHub
parent 900e57657e
commit 207735cedc
4 changed files with 19 additions and 4 deletions

View File

@@ -222,4 +222,10 @@ class GuildTemplate extends Base {
}
}
/**
* Regular expression that globally matches guild template links
* @type {RegExp}
*/
GuildTemplate.GUILD_TEMPLATES_PATTERN = /discord(?:app)?\.(?:com\/template|new)\/([\w-]{2,255})/gi;
module.exports = GuildTemplate;

View File

@@ -191,4 +191,10 @@ class Invite extends Base {
}
}
/**
* Regular expression that globally matches Discord invite links
* @type {RegExp}
*/
Invite.INVITES_PATTERN = /discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/gi;
module.exports = Invite;