UNPKG

discord-guildpeek

Version:

Get a public preview of a Discord server from its invite code, without authentication.

13 lines (12 loc) 462 B
/** * Extracts the invite ID from a Discord invite URL. * * Accepts invite links in the following formats: * - `https://discord.gg/{id}` * - `https://discord.com/invite/{id}` * * @param url - The Discord invite URL to extract the invite ID from. * @returns The extracted invite ID as a string. * @throws {Error} If the URL does not match the expected Discord invite link formats. */ export declare function extractDiscordInviteId(url: string): string;