mirror of
https://github.com/danbulant/discord.js
synced 2026-07-09 05:00:48 +00: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:
parent
55141b408b
commit
61f5051dfd
1 changed files with 1 additions and 1 deletions
|
|
@ -149,7 +149,7 @@ class ClientDataResolver {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
resolveInviteCode(data) {
|
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);
|
const match = inviteRegex.exec(data);
|
||||||
if (match && match[1]) return match[1];
|
if (match && match[1]) return match[1];
|
||||||
return data;
|
return data;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue