mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Fix invite resolver (#1318)
Old version only worked with temporary links. Now works with: vanity invites, and permanent invites.
This commit is contained in:
committed by
Schuyler Cebulskie
parent
55141b408b
commit
61f5051dfd
@@ -149,7 +149,7 @@ class ClientDataResolver {
|
||||
* @returns {string}
|
||||
*/
|
||||
resolveInviteCode(data) {
|
||||
const inviteRegex = /discord(?:app)?\.(?:gg|com\/invite)\/([a-z0-9]{5})/i;
|
||||
const inviteRegex = /discord(?:app\.com\/invite|\.gg)\/([\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