mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(DataResolver): resolveInviteCode to support new domain (#4281)
Update resolveInviteCode method to support "discord.com/invite" links.
This commit is contained in:
@@ -30,7 +30,7 @@ class DataResolver {
|
||||
* @returns {string}
|
||||
*/
|
||||
static resolveInviteCode(data) {
|
||||
const inviteRegex = /discord(?:app\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/i;
|
||||
const inviteRegex = /discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/i;
|
||||
const match = inviteRegex.exec(data);
|
||||
if (match && match[1]) return match[1];
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user