Skip to main content

Variable: DiscordInviteLinkRegex

const DiscordInviteLinkRegex: RegExp

Regex that can can capture the code of Discord invite links

Raw

/(?:^|\b)discord(?:(?:app)?\.com/invite|\.gg(?:/invite)?)/(?<code>[\w-]{2,255})(?:$|\b)/gi

Remark

Capture group 1 is the invite URL's unique code. It is named code.

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:821