UNPKG

discord-inv

Version:

Get more information about a discord invitation link!

39 lines (38 loc) 1.5 kB
import { Snowflake } from "discord-api-types/globals"; import { Invite } from "./Invite"; interface InviteData { /** * URL of the invite */ url: URL; /** * Code of the invite */ code: string; /** * Snowflake of a scheduled guild event */ eventID?: Snowflake; } /** * Extracts data from an discord invite url * @param {string} inviteURL URL to extract data from * @returns {InviteData} Extracted data from URL */ export declare function getInviteDataFromURL(inviteURL: string): InviteData; /** * Extracts data from an invite url and queries the invite from the Discord API * @param {string} inviteURL Discord-Invite-URL * @param {boolean} withCounts `approximate_member_count` and `approximate_presence_count` will only be set, if this is true * @returns {Promise<Invite>} Queried invite */ export declare function getInviteFromURL(inviteURL: string, withCounts?: boolean): Promise<Invite>; /** * Queries an invite from the Discord API by its code * @param {string} code Code of the invite to query * @param {boolean} withCounts `approximate_member_count` and `approximate_presence_count` will only be set, if this is true * @param {Snowflake} eventID Snowflake of an event associated with the invite. `guild_scheduled_event` will only be set, if this is valid * @return {Promise<Invite>} Fetched invite */ export declare function getInvite(code: string, withCounts?: boolean, eventID?: Snowflake): Promise<Invite>; export {};