import { EventEmitter } from "events"; import { Duplex, Readable as ReadableStream, Stream } from "stream"; import { Agent as HTTPSAgent } from "https"; import { IncomingMessage, ClientRequest, IncomingHttpHeaders } from "http"; import OpusScript = require("opusscript"); // Thanks TypeScript import { URL } from "url"; import { Socket as DgramSocket } from "dgram"; import * as WebSocket from "ws"; declare function Eris(token: string, options?: Eris.ClientOptions): Eris.Client; declare namespace Eris { export const Constants: Constants; export const VERSION: string; // TYPES // Application Commands type AnyApplicationCommand = ChatInputApplicationCommand | MessageApplicationCommand | UserApplicationCommand; type ApplicationCommandStructure = ChatInputApplicationCommandStructure | MessageApplicationCommandStructure | UserApplicationCommandStructure; type ChatInputApplicationCommand = ApplicationCommand; type ChatInputApplicationCommandStructure = Omit; type MessageApplicationCommand = Omit, "description" | "options">; type MessageApplicationCommandStructure = Omit; type UserApplicationCommand = Omit, "description" | "options">; type UserApplicationCommandStructure = Omit; type ApplicationCommandOptions = ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsSubCommandGroup | ApplicationCommandOptionsWithValue; type ApplicationCommandOptionsBoolean = ApplicationCommandOption; type ApplicationCommandOptionsChannel = ApplicationCommandOption; type ApplicationCommandOptionsInteger = ApplicationCommandOptionsIntegerWithAutocomplete | ApplicationCommandOptionsIntegerWithoutAutocomplete | ApplicationCommandOptionsIntegerWithMinMax; type ApplicationCommandOptionsIntegerWithAutocomplete = Omit, "choices" | "min_value" | "max_value"> & AutocompleteEnabled; type ApplicationCommandOptionsIntegerWithoutAutocomplete = Omit, "autocomplete" | "min_value" | "max_value"> & AutocompleteDisabledInteger; type ApplicationCommandOptionsIntegerWithMinMax = Omit, "choices" | "autocomplete"> & AutocompleteDisabledIntegerMinMax; type ApplicationCommandOptionsMentionable = ApplicationCommandOption; type ApplicationCommandOptionsNumber = ApplicationCommandOptionsNumberWithAutocomplete | ApplicationCommandOptionsNumberWithoutAutocomplete | ApplicationCommandOptionsNumberWithMinMax; type ApplicationCommandOptionsNumberWithAutocomplete = Omit, "choices" | "min_value" | "max_value"> & AutocompleteEnabled; type ApplicationCommandOptionsNumberWithoutAutocomplete = Omit, "autocomplete" | "min_value" | "max_value"> & AutocompleteDisabledInteger; type ApplicationCommandOptionsNumberWithMinMax = Omit, "choices" | "autocomplete"> & AutocompleteDisabledIntegerMinMax; type ApplicationCommandOptionsRole = ApplicationCommandOption; type ApplicationCommandOptionsString = ApplicationCommandOptionsStringWithAutocomplete | ApplicationCommandOptionsStringWithoutAutocomplete; type ApplicationCommandOptionsStringWithAutocomplete = Omit, "choices"> & AutocompleteEnabled; type ApplicationCommandOptionsStringWithoutAutocomplete = Omit, "autocomplete"> & AutocompleteDisabled; type ApplicationCommandOptionsUser = ApplicationCommandOption; type ApplicationCommandOptionsWithValue = ApplicationCommandOptionsString | ApplicationCommandOptionsInteger | ApplicationCommandOptionsBoolean | ApplicationCommandOptionsUser | ApplicationCommandOptionsChannel | ApplicationCommandOptionsRole | ApplicationCommandOptionsMentionable | ApplicationCommandOptionsNumber; type ApplicationCommandPermissionTypes = Constants["ApplicationCommandPermissionTypes"][keyof Constants["ApplicationCommandPermissionTypes"]]; type ApplicationCommandTypes = Constants["ApplicationCommandTypes"][keyof Constants["ApplicationCommandTypes"]]; // Cache interface Uncached { id: string } // Channel type AnyChannel = AnyGuildChannel | PrivateChannel; type AnyGuildChannel = GuildTextableChannel | AnyVoiceChannel | CategoryChannel | StoreChannel; type AnyThreadChannel = NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel | ThreadChannel; type AnyVoiceChannel = TextVoiceChannel | StageChannel; type GuildTextableChannel = TextChannel | TextVoiceChannel | NewsChannel; type GuildTextableWithThread = GuildTextableChannel | AnyThreadChannel; type InviteChannel = InvitePartialChannel | Exclude; type PossiblyUncachedSpeakableChannel = VoiceChannel | StageChannel | Uncached; type PossiblyUncachedTextable = Textable | Uncached; type PossiblyUncachedTextableChannel = TextableChannel | Uncached; type TextableChannel = (GuildTextable & GuildTextableChannel) | (ThreadTextable & AnyThreadChannel) | (Textable & PrivateChannel); type VideoQualityMode = Constants["VideoQualityModes"][keyof Constants["VideoQualityModes"]]; type ChannelTypes = GuildChannelTypes | PrivateChannelTypes; type GuildChannelTypes = Exclude; type TextChannelTypes = GuildTextChannelTypes | PrivateChannelTypes; type GuildTextChannelTypes = Constants["ChannelTypes"][keyof Pick]; type GuildThreadChannelTypes = Constants["ChannelTypes"][keyof Pick]; type GuildPublicThreadChannelTypes = Exclude; type PrivateChannelTypes = Constants["ChannelTypes"][keyof Pick]; type TextVoiceChannelTypes = Constants["ChannelTypes"][keyof Pick]; // Command type CommandGenerator = CommandGeneratorFunction | MessageContent | MessageContent[] | CommandGeneratorFunction[]; type CommandGeneratorFunction = (msg: Message, args: string[]) => GeneratorFunctionReturn; type GeneratorFunctionReturn = Promise | Promise | MessageContent | void; type GenericCheckFunction = (msg: Message) => T | Promise; type ReactionButtonsFilterFunction = (msg: Message, emoji: Emoji, userID: string) => boolean; type ReactionButtonsGenerator = ReactionButtonsGeneratorFunction | MessageContent | MessageContent[] | ReactionButtonsGeneratorFunction[]; type ReactionButtonsGeneratorFunction = (msg: Message, args: string[], userID: string) => GeneratorFunctionReturn; // Gateway/REST type IntentStrings = keyof Constants["Intents"]; type ReconnectDelayFunction = (lastDelay: number, attempts: number) => number; type RequestMethod = "GET" | "PATCH" | "DELETE" | "POST" | "PUT"; // Guild type DefaultNotifications = Constants["DefaultMessageNotificationLevels"][keyof Constants["DefaultMessageNotificationLevels"]]; type ExplicitContentFilter = Constants["ExplicitContentFilterLevels"][keyof Constants["ExplicitContentFilterLevels"]]; type GuildFeatures = Constants["GuildFeatures"][number]; type GuildScheduledEventEditOptions = GuildScheduledEventEditOptionsExternal | GuildScheduledEventEditOptionsDiscord | GuildScheduledEventEditOptionsBase; type GuildScheduledEventOptions = GuildScheduledEventOptionsExternal | GuildScheduledEventOptionsDiscord | GuildScheduledEventOptionsBase; type GuildScheduledEventEntityTypes = Constants["GuildScheduledEventEntityTypes"][keyof Constants["GuildScheduledEventEntityTypes"]]; type GuildScheduledEventPrivacyLevel = Constants["GuildScheduledEventPrivacyLevel"][keyof Constants["GuildScheduledEventPrivacyLevel"]]; type GuildScheduledEventStatus = Constants["GuildScheduledEventStatus"][keyof Constants["GuildScheduledEventStatus"]]; type NSFWLevel = Constants["GuildNSFWLevels"][keyof Constants["GuildNSFWLevels"]]; type PossiblyUncachedGuild = Guild | Uncached; type PossiblyUncachedGuildScheduledEvent = GuildScheduledEvent | Uncached; type PremiumTier = Constants["PremiumTiers"][keyof Constants["PremiumTiers"]]; type VerificationLevel = Constants["VerificationLevels"][keyof Constants["VerificationLevels"]]; type SystemChannelFlags = Constants["SystemChannelFlags"][keyof Constants["SystemChannelFlags"]]; type GuildIntegrationTypes = Constants["GuildIntegrationTypes"][number]; type GuildIntegrationExpireBehavior = Constants["GuildIntegrationExpireBehavior"][keyof Constants["GuildIntegrationExpireBehavior"]]; // Interaction type AnyInteraction = PingInteraction | CommandInteraction | ComponentInteraction | AutocompleteInteraction; type InteractionCallbackData = InteractionAutocomplete | InteractionContent; type InteractionContent = Pick; type InteractionContentEdit = Pick; type InteractionDataOptions = InteractionDataOptionsSubCommand | InteractionDataOptionsSubCommandGroup | InteractionDataOptionsWithValue; type InteractionDataOptionsBoolean = InteractionDataOptionWithValue; type InteractionDataOptionsChannel = InteractionDataOptionWithValue; type InteractionDataOptionsInteger = InteractionDataOptionWithValue; type InteractionDataOptionsMentionable = InteractionDataOptionWithValue; type InteractionDataOptionsNumber = InteractionDataOptionWithValue; type InteractionDataOptionsRole = InteractionDataOptionWithValue; type InteractionDataOptionsString = InteractionDataOptionWithValue; type InteractionDataOptionsUser = InteractionDataOptionWithValue; type InteractionDataOptionsWithValue = InteractionDataOptionsString | InteractionDataOptionsInteger | InteractionDataOptionsBoolean | InteractionDataOptionsUser | InteractionDataOptionsChannel | InteractionDataOptionsRole | InteractionDataOptionsMentionable | InteractionDataOptionsNumber; type InteractionResponseTypes = Constants["InteractionResponseTypes"][keyof Constants["InteractionResponseTypes"]]; type InteractionTypes = Constants["InteractionTypes"][keyof Constants["InteractionTypes"]]; // Invite type InviteTargetTypes = Constants["InviteTargetTypes"][keyof Constants["InviteTargetTypes"]]; // Message type ActionRowComponents = Button | SelectMenu; type Button = InteractionButton | URLButton; type ButtonStyles = Constants["ButtonStyles"][keyof Constants["ButtonStyles"]]; type Component = ActionRow | ActionRowComponents; type ImageFormat = Constants["ImageFormats"][number]; type MessageActivityFlags = Constants["MessageActivityFlags"][keyof Constants["MessageActivityFlags"]]; type MessageContent = string | AdvancedMessageContent; type MessageContentEdit = string | AdvancedMessageContentEdit; type MFALevel = Constants["MFALevels"][keyof Constants["MFALevels"]]; type PossiblyUncachedMessage = Message | { channel: TextableChannel | { id: string; guild?: Uncached }; guildID?: string; id: string }; // Permission type PermissionType = Constants["PermissionOverwriteTypes"][keyof Constants["PermissionOverwriteTypes"]]; // Presence/Relationship type ActivityType = BotActivityType | Constants["ActivityTypes"]["CUSTOM"]; type BotActivityType = Constants["ActivityTypes"][Exclude]; type FriendSuggestionReasons = { name: string; platform_type: string; type: number }[]; type Status = "online" | "idle" | "dnd"; type SelfStatus = Status | "invisible"; type UserStatus = Status | "offline"; // Selfbot type ConnectionVisibilityTypes = Constants["ConnectionVisibilityTypes"][keyof Constants["ConnectionVisibilityTypes"]]; // Sticker type StickerTypes = Constants["StickerTypes"][keyof Constants["StickerTypes"]]; type StickerFormats = Constants["StickerFormats"][keyof Constants["StickerFormats"]]; // Thread type AutoArchiveDuration = 60 | 1440 | 4320 | 10080; // User type PremiumTypes = Constants["PremiumTypes"][keyof Constants["PremiumTypes"]]; // Voice type ConverterCommand = "./ffmpeg" | "./avconv" | "ffmpeg" | "avconv"; type StageInstancePrivacyLevel = Constants["StageInstancePrivacyLevel"][keyof Constants["StageInstancePrivacyLevel"]]; // Webhook type MessageWebhookContent = Pick; type WebhookTypes = Constants["WebhookTypes"][keyof Constants["WebhookTypes"]]; // INTERFACES // Internals interface JSONCache { [s: string]: unknown; } interface NestedJSON { toJSON(arg?: unknown, cache?: (string | unknown)[]): JSONCache; } interface SimpleJSON { toJSON(props?: string[]): JSONCache; } // Application Commands interface ApplicationCommand { application_id: string; defaultPermission?: boolean; description: T extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? string : never; guild_id?: string; id: string; name: string; options?: ApplicationCommandOptions[]; type: T; } interface ApplicationCommandOptionsSubCommand { description: string; name: string; options?: ApplicationCommandOptionsWithValue[]; type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND"]; } interface ApplicationCommandOptionsSubCommandGroup { description: string; name: string; options?: (ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsWithValue)[]; type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND_GROUP"]; } interface ApplicationCommandOptionChoice] | unknown = unknown> { name: string; value: T extends Constants["ApplicationCommandOptionTypes"]["STRING"] ? string : T extends Constants["ApplicationCommandOptionTypes"]["NUMBER"] ? number : T extends Constants["ApplicationCommandOptionTypes"]["INTEGER"] ? number : number | string; } interface ApplicationCommandOptionWithChoices] = Constants["ApplicationCommandOptionTypes"][keyof Pick]> { autocomplete?: boolean; choices?: ApplicationCommandOptionChoice[]; description: string; name: string; required?: boolean; type: T; } interface ApplicationCommandOptionWithMinMax] = Constants["ApplicationCommandOptionTypes"][keyof Pick]> { autocomplete?: boolean; choices?: ApplicationCommandOptionChoice[]; description: string; max_value?: number; min_value?: number; name: string; required?: boolean; type: T; } interface ApplicationCommandOption]> { channel_types: T extends Constants["ApplicationCommandOptionTypes"]["CHANNEL"] ? ChannelTypes | undefined : never; description: string; name: string; required?: boolean; type: T; } interface ApplicationCommandPermissions { id: string; permission: boolean; type: ApplicationCommandPermissionTypes; } interface AutocompleteEnabled { autocomplete: true; } interface AutocompleteDisabled { autocomplete?: false; } interface AutocompleteDisabledInteger extends AutocompleteDisabled { min_value?: null; max_value?: null; } interface AutocompleteDisabledIntegerMinMax extends AutocompleteDisabled { choices?: null; } interface GuildApplicationCommandPermissions { application_id: string; guild_id: string; id: string; permissions?: ApplicationCommandPermissions[]; } // Channel interface ChannelFollow { channel_id: string; webhook_id: string; } interface ChannelPosition { id: string; position: number; lockPermissions?: boolean; parentID?: string; } interface CreateChannelOptions { bitrate?: number; nsfw?: boolean; parentID?: string; permissionOverwrites?: Overwrite[]; position?: number; rateLimitPerUser?: number; reason?: string; topic?: string; userLimit?: number; } interface EditChannelOptions extends Omit { archived?: boolean; autoArchiveDuration?: AutoArchiveDuration; defaultAutoArchiveDuration?: AutoArchiveDuration; icon?: string; invitable?: boolean; locked?: boolean; name?: string; ownerID?: string; rtcRegion?: string | null; videoQualityMode?: VideoQualityMode; } interface EditChannelPositionOptions { lockPermissions?: string; parentID?: string; } interface GetMessagesOptions { after?: string; around?: string; before?: string; limit?: number; } interface GuildPinnable extends Pinnable { lastPinTimestamp: number | null; topic?: string | null; } interface GuildTextable extends Textable { rateLimitPerUser: number; createWebhook(options: { name: string; avatar?: string | null }, reason?: string): Promise; deleteMessages(messageIDs: string[], reason?: string): Promise; getWebhooks(): Promise; purge(options: PurgeChannelOptions): Promise; removeMessageReactionEmoji(messageID: string, reaction: string): Promise; removeMessageReactions(messageID: string): Promise; } interface PartialChannel { bitrate?: number; id: string; name?: string; nsfw?: boolean; parent_id?: number; permission_overwrites?: Overwrite[]; rate_limit_per_user?: number; topic?: string; type: number; user_limit?: number; } interface Pinnable { getPins(): Promise; pinMessage(messageID: string): Promise; unpinMessage(messageID: string): Promise; } interface PurgeChannelOptions { after?: string; before?: string; filter?: (m: Message) => boolean; limit: number; reason?: string; } interface Textable { lastMessageID: string; messages: Collection>; addMessageReaction(messageID: string, reaction: string): Promise; /** @deprecated */ addMessageReaction(messageID: string, reaction: string, userID: string): Promise; createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise>; deleteMessage(messageID: string, reason?: string): Promise; editMessage(messageID: string, content: MessageContentEdit): Promise>; getMessage(messageID: string): Promise>; getMessageReaction(messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise; /** @deprecated */ getMessageReaction(messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise; getMessages(options?: GetMessagesOptions): Promise[]>; /** @deprecated */ getMessages(limit?: number, before?: string, after?: string, around?: string): Promise; removeMessageReaction(messageID: string, reaction: string, userID?: string): Promise; sendTyping(): Promise; unsendMessage(messageID: string): Promise; } // @ts-ignore ts(2430) - ThreadTextable can't properly extend Textable because of getMessageReaction deprecated overload interface ThreadTextable extends Textable, Pinnable { lastPinTimestamp?: number; deleteMessages(messageIDs: string[], reason?: string): Promise; getMembers(): Promise; join(userID: string): Promise; leave(userID: string): Promise; purge(options: PurgeChannelOptions): Promise; removeMessageReactionEmoji(messageID: string, reaction: string): Promise; removeMessageReactions(messageID: string): Promise; } interface WebhookData { channelID: string; guildID: string; } // Client interface ClientOptions { /** @deprecated */ agent?: HTTPSAgent; allowedMentions?: AllowedMentions; autoreconnect?: boolean; compress?: boolean; connectionTimeout?: number; defaultImageFormat?: string; defaultImageSize?: number; disableEvents?: { [s: string]: boolean }; firstShardID?: number; getAllUsers?: boolean; guildCreateTimeout?: number; intents: number | (IntentStrings | number)[]; largeThreshold?: number; lastShardID?: number; /** @deprecated */ latencyThreshold?: number; maxReconnectAttempts?: number; maxResumeAttempts?: number; maxShards?: number | "auto"; messageLimit?: number; opusOnly?: boolean; /** @deprecated */ ratelimiterOffset?: number; reconnectDelay?: ReconnectDelayFunction; requestTimeout?: number; rest?: RequestHandlerOptions; restMode?: boolean; seedVoiceConnections?: boolean; shardConcurrency?: number | "auto"; ws?: unknown; } interface CommandClientOptions { argsSplitter?: (str: string) => string[]; defaultCommandOptions?: CommandOptions; defaultHelpCommand?: boolean; description?: string; ignoreBots?: boolean; ignoreSelf?: boolean; name?: string; owner?: string; prefix?: string | string[]; } interface RequestHandlerOptions { agent?: HTTPSAgent; baseURL?: string; decodeReasons?: boolean; disableLatencyCompensation?: boolean; domain?: string; latencyThreshold?: number; ratelimiterOffset?: number; requestTimeout?: number; } // Command interface CommandCooldownExclusions { channelIDs?: string[]; guildIDs?: string[]; userIDs?: string[]; } interface CommandOptions { aliases?: string[]; argsRequired?: boolean; caseInsensitive?: boolean; cooldown?: number; cooldownExclusions?: CommandCooldownExclusions; cooldownMessage?: MessageContent | GenericCheckFunction | false; cooldownReturns?: number; defaultSubcommandOptions?: CommandOptions; deleteCommand?: boolean; description?: string; dmOnly?: boolean; errorMessage?: MessageContent | GenericCheckFunction; fullDescription?: string; guildOnly?: boolean; hidden?: boolean; hooks?: Hooks; invalidUsageMessage?: MessageContent | GenericCheckFunction | false; permissionMessage?: MessageContent | GenericCheckFunction | false; reactionButtons?: CommandReactionButtonsOptions[] | null; reactionButtonTimeout?: number; requirements?: CommandRequirements; restartCooldown?: boolean; usage?: string; } interface CommandReactionButtons extends CommandReactionButtonsOptions { execute: (msg: Message, args: string[], userID: string) => string | GeneratorFunctionReturn; responses: ((() => string) | ReactionButtonsGeneratorFunction)[]; } interface CommandReactionButtonsOptions { emoji: string; filter: ReactionButtonsFilterFunction; response: string | ReactionButtonsGeneratorFunction; type: "edit" | "cancel"; } interface CommandRequirements { custom?: GenericCheckFunction; permissions?: { [s: string]: boolean } | GenericCheckFunction<{ [s: string]: boolean }>; roleIDs?: string[] | GenericCheckFunction; roleNames?: string[] | GenericCheckFunction; userIDs?: string[] | GenericCheckFunction; } interface Hooks { postCheck?: (msg: Message, args: string[], checksPassed: boolean) => void; postCommand?: (msg: Message, args: string[], sent?: Message) => void; postExecution?: (msg: Message, args: string[], executionSuccess: boolean) => void; preCommand?: (msg: Message, args: string[]) => void; } // Embed // Omit used to override interface Embed extends Omit { author?: EmbedAuthor; footer?: EmbedFooter; image?: EmbedImage; provider?: EmbedProvider; thumbnail?: EmbedImage; type: string; video?: EmbedVideo; } interface EmbedAuthor extends EmbedAuthorOptions { proxy_icon_url?: string; } interface EmbedAuthorOptions { icon_url?: string; name: string; url?: string; } interface EmbedField { inline?: boolean; name: string; value: string; } interface EmbedFooter extends EmbedFooterOptions { proxy_icon_url?: string; } interface EmbedFooterOptions { icon_url?: string; text: string; } interface EmbedImage extends EmbedImageOptions { height?: number; proxy_url?: string; width?: number; } interface EmbedImageOptions { url?: string; } interface EmbedOptions { author?: EmbedAuthorOptions; color?: number; description?: string; fields?: EmbedField[]; footer?: EmbedFooterOptions; image?: EmbedImageOptions; thumbnail?: EmbedImageOptions; timestamp?: Date | string; title?: string; url?: string; } interface EmbedProvider { name?: string; url?: string; } interface EmbedVideo { height?: number; proxy_url?: string; url?: string; width?: number; } // Emoji interface Emoji extends EmojiBase { animated: boolean; available: boolean; id: string; managed: boolean; require_colons: boolean; roles: string[]; user?: PartialUser; } interface EmojiBase { icon?: string; name: string; } interface EmojiOptions extends Exclude { image: string; roles?: string[]; } interface PartialEmoji { id: string | null; name: string; animated?: boolean; } // Events interface OldCall { endedTimestamp?: number; participants: string[]; region: string; ringing: string[]; unavailable: boolean; } interface OldGroupChannel { name: string; ownerID: string; icon: string; type: Constants["ChannelTypes"]["GROUP_DM"]; } interface OldGuild { afkChannelID: string | null; afkTimeout: number; autoRemoved: boolean | null; banner: string | null; defaultNotifications: DefaultNotifications; description: string | null; discoverySplash: string | null; emojiCount: number | null; emojis: Omit[]; explicitContentFilter: ExplicitContentFilter; features: GuildFeatures[]; icon: string | null; keywords: string[] | null; large: boolean; maxMembers?: number; maxVideoChannelUsers?: number; mfaLevel: MFALevel; name: string; /** @deprecated */ nsfw: boolean; nsfwLevel: NSFWLevel; ownerID: string; premiumProgressBarEnabled: boolean; preferredLocale?: string; premiumSubscriptionCount?: number; premiumTier: PremiumTier; primaryCategory?: DiscoveryCategory; primaryCategoryID: number | null; publicUpdatesChannelID: string | null; rulesChannelID: string | null; splash: string | null; stickers?: Sticker[]; systemChannelFlags: SystemChannelFlags; systemChannelID: string | null; vanityURL: string | null; verificationLevel: VerificationLevel; welcomeScreen?: WelcomeScreen; } interface OldGuildChannel { bitrate?: number; name: string; nsfw?: boolean; parentID: string | null; permissionOverwrites: Collection; position: number; rateLimitPerUser?: number; rtcRegion?: string | null; topic?: string | null; type: GuildChannelTypes; } interface OldGuildScheduledEvent { channel: PossiblyUncachedSpeakableChannel | null; description?: string | null; entityID: string | null; enitityMetadata: GuildScheduledEventMetadata | null; entityType: GuildScheduledEventEntityTypes; image?: string; name: string; privacyLevel: GuildScheduledEventPrivacyLevel; scheduledEndTime: number | null; scheduledStartTime: number; status: GuildScheduledEventStatus; } interface OldGuildTextChannel extends OldGuildChannel { nsfw: boolean; rateLimitPerUser: number; topic: string | null; type: GuildTextChannelTypes; } interface OldMember { avatar: string | null; communicationDisabledUntil: number | null; nick: string | null; pending?: boolean; premiumSince?: number | null; roles: string[]; } interface OldMessage { attachments: Attachment[]; channelMentions: string[]; content: string; editedTimestamp?: number; embeds: Embed[]; flags: number; mentionedBy?: unknown; mentions: User[]; pinned: boolean; roleMentions: string[]; tts: boolean; } interface OldRole { color: number; hoist: boolean; icon: string | null; managed: boolean; mentionable: boolean; name: string; permissions: Permission; position: number; unicodeEmoji: string | null; } interface OldStageInstance { discoverableDisabled: boolean; privacyLevel: StageInstancePrivacyLevel; topic: string; } interface OldTextVoiceChannel extends OldGuildChannel { bitrate: number; rtcRegion: string | null; type: TextVoiceChannelTypes; userLimit: number; videoQualityMode: VideoQualityMode; } interface OldThread { name: string; rateLimitPerUser: number; threadMetadata: ThreadMetadata; } interface OldThreadMember { flags: number; } interface OldVoiceState { deaf: boolean; mute: boolean; selfDeaf: boolean; selfMute: boolean; selfStream: boolean; selfVideo: boolean; } interface EventListeners { callCreate: [call: Call]; callDelete: [call: Call]; callRing: [call: Call]; callUpdate: [call: Call, oldCall: OldCall]; channelCreate: [channel: AnyGuildChannel]; channelDelete: [channel: AnyChannel]; channelPinUpdate: [channel: TextableChannel, timestamp: number, oldTimestamp: number]; channelRecipientAdd: [channel: GroupChannel, user: User]; channelRecipientRemove: [channel: GroupChannel, user: User]; channelUpdate: [channel: AnyGuildChannel, oldChannel: OldGuildChannel | OldGuildTextChannel | OldTextVoiceChannel] | [channel: GroupChannel, oldChannel: OldGroupChannel]; connect: [id: number]; debug: [message: string, id?: number]; disconnect: []; error: [err: Error, id?: number]; friendSuggestionCreate: [user: User, reasons: FriendSuggestionReasons]; friendSuggestionDelete: [user: User]; guildAvailable: [guild: Guild]; guildBanAdd: [guild: Guild, user: User]; guildBanRemove: [guild: Guild, user: User]; guildCreate: [guild: Guild]; guildDelete: [guild: PossiblyUncachedGuild]; guildEmojisUpdate: [guild: PossiblyUncachedGuild, emojis: Emoji[], oldEmojis: Emoji[] | null]; guildMemberAdd: [guild: Guild, member: Member]; guildMemberChunk: [guild: Guild, member: Member[]]; guildMemberRemove: [guild: Guild, member: Member | MemberPartial]; guildMemberUpdate: [guild: Guild, member: Member, oldMember: OldMember | null]; guildRoleCreate: [guild: Guild, role: Role]; guildRoleDelete: [guild: Guild, role: Role]; guildRoleUpdate: [guild: Guild, role: Role, oldRole: OldRole]; guildScheduledEventCreate: [event: GuildScheduledEvent]; guildScheduledEventDelete: [event: GuildScheduledEvent]; guildScheduledEventUpdate: [event: GuildScheduledEvent, oldEvent: OldGuildScheduledEvent | null]; guildScheduledEventUserAdd: [event: PossiblyUncachedGuildScheduledEvent, user: User | Uncached]; guildScheduledEventUserRemove: [event: PossiblyUncachedGuildScheduledEvent, user: User | Uncached]; guildStickersUpdate: [guild: PossiblyUncachedGuild, stickers: Sticker[], oldStickers: Sticker[] | null]; guildUnavailable: [guild: UnavailableGuild]; guildUpdate: [guild: Guild, oldGuild: OldGuild]; hello: [trace: string[], id: number]; interactionCreate: [interaction: PingInteraction | CommandInteraction | ComponentInteraction | AutocompleteInteraction | UnknownInteraction]; inviteCreate: [guild: Guild, invite: Invite]; inviteDelete: [guild: Guild, invite: Invite]; messageCreate: [message: Message]; messageDelete: [message: PossiblyUncachedMessage]; messageDeleteBulk: [messages: PossiblyUncachedMessage[]]; messageReactionAdd: [message: PossiblyUncachedMessage, emoji: PartialEmoji, reactor: Member | Uncached]; messageReactionRemove: [message: PossiblyUncachedMessage, emoji: PartialEmoji, userID: string]; messageReactionRemoveAll: [message: PossiblyUncachedMessage]; messageReactionRemoveEmoji: [message: PossiblyUncachedMessage, emoji: PartialEmoji]; messageUpdate: [message: Message, oldMessage: OldMessage | null]; presenceUpdate: [other: Member | Relationship, oldPresence: Presence | null]; rawREST: [request: RawRESTRequest]; rawWS: [packet: RawPacket, id: number]; ready: []; relationshipAdd: [relationship: Relationship]; relationshipRemove: [relationship: Relationship]; relationshipUpdate: [relationship: Relationship, oldRelationship: { type: number }]; shardPreReady: [id: number]; stageInstanceCreate: [stageInstance: StageInstance]; stageInstanceDelete: [stageInstance: StageInstance]; stageInstanceUpdate: [stageInstance: StageInstance, oldStageInstance: OldStageInstance | null]; threadCreate: [channel: AnyThreadChannel]; threadDelete: [channel: AnyThreadChannel]; threadListSync: [guild: Guild, deletedThreads: (AnyThreadChannel | Uncached)[], activeThreads: AnyThreadChannel[], joinedThreadsMember: ThreadMember[]]; threadMembersUpdate: [channel: AnyThreadChannel, addedMembers: ThreadMember[], removedMembers: (ThreadMember | Uncached)[]]; threadMemberUpdate: [channel: AnyThreadChannel, member: ThreadMember, oldMember: OldThreadMember]; threadUpdate: [channel: AnyThreadChannel, oldChannel: OldThread | null]; typingStart: [channel: GuildTextableChannel | Uncached, user: User | Uncached, member: Member] | [channel: PrivateChannel | Uncached, user: User | Uncached, member: null]; unavailableGuildCreate: [guild: UnavailableGuild]; unknown: [packet: RawPacket, id?: number]; userUpdate: [user: User, oldUser: PartialUser | null]; voiceChannelJoin: [member: Member, channel: AnyVoiceChannel]; voiceChannelLeave: [member: Member, channel: AnyVoiceChannel]; voiceChannelSwitch: [member: Member, newChannel: AnyVoiceChannel, oldChannel: AnyVoiceChannel]; voiceStateUpdate: [member: Member, oldState: OldVoiceState]; warn: [message: string, id?: number]; webhooksUpdate: [data: WebhookData]; } interface ClientEvents extends EventListeners { shardDisconnect: [err: Error | undefined, id: number]; shardReady: [id: number]; shardResume: [id: number]; } interface ShardEvents extends EventListeners { resume: []; } interface StreamEvents { end: []; error: [err: Error]; start: []; } interface VoiceEvents { connect: []; debug: [message: string]; disconnect: [err?: Error]; end: []; error: [err: Error]; pong: [latency: number]; ready: []; speakingStart: [userID: string]; speakingStop: [userID: string]; start: []; unknown: [packet: RawPacket]; userDisconnect: [userID: string]; warn: [message: string]; } // Gateway/REST interface HTTPResponse { code: number; message: string; } interface LatencyRef { lastTimeOffsetCheck: number; latency: number; raw: number[]; timeOffset: number; timeOffsets: number[]; } interface RawPacket { d?: unknown; op: number; s?: number; t?: string; } interface RawRESTRequest { auth: boolean; body?: unknown; file?: FileContent; method: string; resp: IncomingMessage; route: string; short: boolean; url: string; } interface RequestMembersPromise { members: Member; received: number; res: (value: Member[]) => void; timeout: NodeJS.Timeout; } interface ShardManagerOptions { concurrency?: number | "auto"; } // Guild interface AddGuildMemberOptions { nick?: string; roles?: string[]; deaf?: boolean; mute?: boolean; } interface CreateGuildOptions { afkChannelID?: string; afkTimeout?: number; channels?: PartialChannel[]; defaultNotifications?: DefaultNotifications; explicitContentFilter?: ExplicitContentFilter; icon?: string; roles?: PartialRole[]; systemChannelID: string; verificationLevel?: VerificationLevel; } interface DiscoveryCategory { id: number; is_primary: boolean; name: { default: string; localizations?: { [lang: string]: string }; }; } interface DiscoveryMetadata { category_ids: number[]; emoji_discoverability_enabled: boolean; guild_id: string; keywords: string[] | null; primary_category_id: number; } interface DiscoveryOptions { emojiDiscoverabilityEnabled?: boolean; keywords?: string[]; primaryCategoryID?: string; reason?: string; } interface DiscoverySubcategoryResponse { category_id: number; guild_id: string; } interface GetGuildAuditLogOptions { actionType?: number; before?: string; limit?: number; userID?: string; } interface GetGuildBansOptions { after?: string; before?: string; limit?: number; } interface GetGuildScheduledEventOptions { withUserCount?: boolean; } interface GetGuildScheduledEventUsersOptions { after?: string; before?: string; limit?: number; withMember?: boolean; } interface GetPruneOptions { days?: number; includeRoles?: string[]; } interface GetRESTGuildMembersOptions { after?: string; limit?: number; } interface GetRESTGuildsOptions { after?: string; before?: string; limit?: number; } interface GuildAuditLog { entries: GuildAuditLogEntry[]; integrations: GuildIntegration[]; threads: AnyThreadChannel[]; users: User[]; webhooks: Webhook[]; } interface GuildBan { reason?: string; user: User; } interface GuildOptions { afkChannelID?: string; afkTimeout?: number; banner?: string; defaultNotifications?: DefaultNotifications; description?: string; discoverySplash?: string; explicitContentFilter?: ExplicitContentFilter; features?: GuildFeatures[]; // Though only some are editable? icon?: string; name?: string; ownerID?: string; preferredLocale?: string; publicUpdatesChannelID?: string; rulesChannelID?: string; splash?: string; systemChannelFlags?: number; systemChannelID?: string; verificationLevel?: VerificationLevel; } interface GuildScheduledEventMetadata { location?: string; } interface GuildScheduledEventEditOptionsBase { channelID?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? null : string; description?: string | null; entityMetadata?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Required : GuildScheduledEventMetadata | null; entityType?: T; image?: string; name?: string; privacyLevel?: GuildScheduledEventPrivacyLevel; scheduledEndTime?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Date : Date | undefined; scheduledStartTime?: Date; status?: GuildScheduledEventStatus; } interface GuildScheduledEventEditOptionsDiscord extends GuildScheduledEventEditOptionsBase> { channelID: string; entityMetadata: GuildScheduledEventMetadata; } interface GuildScheduledEventEditOptionsExternal extends GuildScheduledEventEditOptionsBase { channelID: null; enitityMetadata: Required; scheduledEndTime: Date; } interface GuildScheduledEventOptionsBase extends Omit, "entityMetadata" | "status"> { channelID: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? never : string; entityMetadata?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Required : GuildScheduledEventMetadata | undefined; entityType: T; name: string; privacyLevel: GuildScheduledEventPrivacyLevel; scheduledStartTime: Date; } interface GuildScheduledEventOptionsDiscord extends GuildScheduledEventEditOptionsBase> { channelID: string; entityMetadata: GuildScheduledEventMetadata; } interface GuildScheduledEventOptionsExternal extends GuildScheduledEventOptionsBase { channelID: never; enitityMetadata: Required; scheduledEndTime: Date; } interface GuildScheduledEventUser { guildScheduledEventID: string; user: User; member?: Member; } interface GuildTemplateOptions { name?: string; description?: string | null; } interface GuildVanity { code: string | null; uses: number; } interface IntegrationApplication { bot?: User; description: string; icon: string | null; id: string; name: string; summary: string; } interface IntegrationOptions { enableEmoticons?: string; expireBehavior?: string; expireGracePeriod?: string; } interface PruneMemberOptions extends GetPruneOptions { computePruneCount?: boolean; reason?: string; } interface VoiceRegion { custom: boolean; deprecated: boolean; id: string; name: string; optimal: boolean; vip: boolean; } interface WelcomeChannel { channelID: string; description: string; emojiID: string | null; emojiName: string | null; } interface WelcomeScreen { description: string; welcomeChannels: WelcomeChannel[]; } interface WelcomeScreenOptions extends WelcomeScreen { enabled: boolean; } interface Widget { channel_id?: string; enabled: boolean; } interface WidgetChannel { id: string; name: string; position: number; } interface WidgetData { channels: WidgetChannel[]; id: string; instant_invite: string; members: WidgetMember[]; name: string; presence_count: number; } interface WidgetMember { avatar: string | null; avatar_url: string; discriminator: string; id: string; status: string; username: string; } // Interaction interface InteractionAutocomplete { choices: ApplicationCommandOptionChoice[]; } interface InteractionDataOptionsSubCommand { name: string; options?: InteractionDataOptions[]; type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND"]; } interface InteractionDataOptionsSubCommandGroup { name: string; options: InteractionDataOptions[]; type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND_GROUP"]; } interface InteractionDataOptionWithValue] = Constants["ApplicationCommandOptionTypes"][Exclude], V = unknown> { focused?: boolean; name: string; type: T; value: V; } interface InteractionOptions { data?: InteractionCallbackData; type: InteractionResponseTypes; } // Invite interface CreateChannelInviteOptions extends CreateInviteOptions { targetApplicationID?: string; targetType?: InviteTargetTypes; targetUserID?: string; } interface CreateInviteOptions { maxAge?: number; maxUses?: number; temporary?: boolean; unique?: boolean; } interface Invitable { createInvite(options?: CreateInviteOptions, reason?: string): Promise; getInvites(): Promise; } interface InvitePartialChannel { icon?: string | null; id: string; name: string | null; recipients?: { username: string }[]; type: Exclude; } interface InviteStageInstance { members: Member[]; participantCount: number; speakerCount: number; topic: string; } // Member/User interface FetchMembersOptions { limit?: number; presences?: boolean; query?: string; timeout?: number; userIDs?: string[]; } interface MemberOptions { channelID?: string | null; communicationDisabledUntil?: Date | null; deaf?: boolean; mute?: boolean; nick?: string | null; roles?: string[]; } interface MemberPartial { id: string; user: User; } interface MemberRoles extends BaseData { roles: string[]; } interface PartialUser { accentColor?: number | null; avatar: string | null; banner?: string | null; discriminator: string; id: string; username: string; } interface RequestGuildMembersOptions extends Omit { nonce: string; user_ids?: string[]; } interface RequestGuildMembersReturn { members: Member[]; received: number; res: (value?: unknown) => void; timeout: NodeJS.Timer; } // Message interface ActionRow { components: ActionRowComponents[]; type: Constants["ComponentTypes"]["ACTION_ROW"]; } interface ActiveMessages { args: string[]; command: Command; timeout: NodeJS.Timer; } interface AdvancedMessageContent { allowedMentions?: AllowedMentions; components?: ActionRow[]; content?: string; embed?: EmbedOptions; embeds?: EmbedOptions[]; flags?: number; messageReference?: MessageReferenceReply; /** @deprecated */ messageReferenceID?: string; stickerIDs?: string[]; tts?: boolean; } interface AdvancedMessageContentEdit extends AdvancedMessageContent { file?: FileContent | FileContent[]; } interface AllowedMentions { everyone?: boolean; repliedUser?: boolean; roles?: boolean | string[]; users?: boolean | string[]; } interface Attachment { content_type?: string; ephemeral?: boolean; filename: string; height?: number; id: string; proxy_url: string; size: number; url: string; width?: number; } interface ButtonBase { disabled?: boolean; emoji?: Partial; label?: string; type: Constants["ComponentTypes"]["BUTTON"]; } interface CreateStickerOptions extends Required> { file: FileContent; } interface EditStickerOptions { description?: string; name?: string; tags?: string; } interface SelectMenu { custom_id: string; disabled?: boolean; max_values?: number; min_values?: number; options: SelectMenuOptions[]; placeholder?: string; type: Constants["ComponentTypes"]["SELECT_MENU"]; } interface SelectMenuOptions { default?: boolean; description?: string; emoji?: Partial; label: string; value: string; } interface GetMessageReactionOptions { after?: string; /** @deprecated */ before?: string; limit?: number; } interface InteractionButton extends ButtonBase { custom_id: string; style: Exclude; } interface MessageActivity { party_id?: string; type: MessageActivityFlags; } interface MessageApplication { cover_image?: string; description: string; icon: string | null; id: string; name: string; } interface FileContent { file: Buffer | string; name: string; } interface MessageInteraction { id: string; member: Member | null; name: string; type: InteractionTypes; user: User; } interface MessageReference extends MessageReferenceBase { channelID: string; } interface MessageReferenceBase { channelID?: string; guildID?: string; messageID?: string; } interface MessageReferenceReply extends MessageReferenceBase { messageID: string; failIfNotExists?: boolean; } interface Sticker extends StickerItems { /** @deprecated */ asset: ""; available?: boolean; description: string; guild_id?: string; pack_id?: string; sort_value?: number; tags: string; type: StickerTypes; user?: User; } interface StickerItems { id: string; name: string; format_type: StickerFormats; } interface StickerPack { id: string; stickers: Sticker[]; name: string; sku_id: string; cover_sticker_id?: string; description: string; banner_asset_id: string; } interface URLButton extends ButtonBase { style: Constants["ButtonStyles"]["LINK"]; url: string; } // Presence interface Activity extends ActivityPartial { application_id?: string; assets?: { large_image?: string; large_text?: string; small_image?: string; small_text?: string; [key: string]: unknown; }; created_at: number; details?: string; emoji?: { animated?: boolean; id?: string; name: string }; flags?: number; instance?: boolean; party?: { id?: string; size?: [number, number] }; secrets?: { join?: string; spectate?: string; match?: string }; state?: string; timestamps?: { end?: number; start: number }; type: T; // the stuff attached to this object apparently varies even more than documented, so... [key: string]: unknown; } interface ActivityPartial { name: string; type?: T; url?: string; } interface ClientPresence { activities: Activity[] | null; afk: boolean; since: number | null; status: SelfStatus; } interface ClientStatus { desktop: UserStatus; mobile: UserStatus; web: UserStatus; } interface Presence { activities?: Activity[]; clientStatus?: ClientStatus; status?: UserStatus; } // Role interface Overwrite { allow: bigint | number; deny: bigint | number; id: string; type: PermissionType; } interface PartialRole { color?: number; hoist?: boolean; id: string; mentionable?: boolean; name?: string; permissions?: number; position?: number; } interface RoleOptions { color?: number; hoist?: boolean; icon?: string; mentionable?: boolean; name?: string; permissions?: bigint | number | string | Permission; unicodeEmoji?: string; } interface RoleTags { bot_id?: string; integration_id?: string; premium_subscriber?: true; } // Thread interface CreateThreadOptions { autoArchiveDuration: AutoArchiveDuration; name: string; } interface CreateThreadWithoutMessageOptions extends CreateThreadOptions { invitable: T extends PrivateThreadChannel["type"] ? boolean : never; type: T; } interface GetArchivedThreadsOptions { before?: Date; limit?: number; } interface ListedChannelThreads extends ListedGuildThreads { hasMore: boolean; } interface ListedGuildThreads { members: ThreadMember[]; threads: T[]; } interface PrivateThreadMetadata extends ThreadMetadata { invitable: boolean; } interface ThreadMetadata { archiveTimestamp: number; archived: boolean; autoArchiveDuration: AutoArchiveDuration; locked: boolean; } // Voice interface JoinVoiceChannelOptions { opusOnly?: boolean; selfDeaf?: boolean; selfMute?: boolean; shared?: boolean; } interface StageInstanceOptions { privacyLevel?: StageInstancePrivacyLevel; topic?: string; } interface UncachedMemberVoiceState { id: string; voiceState: OldVoiceState; } interface VoiceConnectData { channel_id: string; endpoint: string; session_id: string; token: string; user_id: string; } interface VoiceResourceOptions { encoderArgs?: string[]; format?: string; frameDuration?: number; frameSize?: number; inlineVolume?: boolean; inputArgs?: string[]; pcmSize?: number; samplingRate?: number; voiceDataTimeout?: number; } interface VoiceServerUpdateData extends Omit { guild_id: string; shard: Shard; } interface VoiceStateOptions { channelID: string; requestToSpeakTimestamp?: Date | null; suppress?: boolean; } interface VoiceStreamCurrent { buffer: Buffer | null; bufferingTicks: number; options: VoiceResourceOptions; pausedTime?: number; pausedTimestamp?: number; playTime: number; startTime: number; timeout: NodeJS.Timeout | null; } // Webhook interface Webhook { application_id: string | null; avatar: string | null; channel_id: string | null; guild_id: string | null; id: string; name: string; source_channel?: { id: string; name: string }; source_guild: { icon: string | null; id: string; name: string }; token?: string; type: WebhookTypes; url?: string; user?: PartialUser; } interface WebhookOptions { avatar?: string; channelID?: string; name?: string; } interface WebhookPayload { allowedMentions?: AllowedMentions; auth?: boolean; avatarURL?: string; components?: ActionRow[]; content?: string; embed?: EmbedOptions; embeds?: EmbedOptions[]; file?: FileContent | FileContent[]; flags?: number; threadID?: string; tts?: boolean; username?: string; wait?: boolean; } // TODO: Does this have more stuff? interface BaseData { id: string; [key: string]: unknown; } interface OAuthApplicationInfo { bot_public: boolean; bot_require_code_grant: boolean; description: string; icon?: string; id: string; name: string; owner: { avatar?: string; discriminator: string; id: string; username: string; }; team: OAuthTeamInfo | null; } interface OAuthTeamInfo { icon: string | null; id: string; members: OAuthTeamMember[]; owner_user_id: string; } interface OAuthTeamMember { membership_state: number; permissions: string[]; team_id: string; user: PartialUser; } interface Constants { GATEWAY_VERSION: 9; REST_VERSION: 9; ActivityTypes: { GAME: 0; STREAMING: 1; LISTENING: 2; WATCHING: 3; CUSTOM: 4; COMPETING: 5; }; ApplicationCommandOptionTypes: { SUB_COMMAND: 1; SUB_COMMAND_GROUP: 2; STRING: 3; INTEGER: 4; BOOLEAN: 5; USER: 6; CHANNEL: 7; ROLE: 8; MENTIONABLE: 9; NUMBER: 10; }; ApplicationCommandPermissionTypes: { ROLE: 1; USER: 2; }; ApplicationCommandTypes: { CHAT_INPUT: 1; USER: 2; MESSAGE: 3; }; AuditLogActions: { GUILD_UPDATE: 1; CHANNEL_CREATE: 10; CHANNEL_UPDATE: 11; CHANNEL_DELETE: 12; CHANNEL_OVERWRITE_CREATE: 13; CHANNEL_OVERWRITE_UPDATE: 14; CHANNEL_OVERWRITE_DELETE: 15; MEMBER_KICK: 20; MEMBER_PRUNE: 21; MEMBER_BAN_ADD: 22; MEMBER_BAN_REMOVE: 23; MEMBER_UPDATE: 24; MEMBER_ROLE_UPDATE: 25; MEMBER_MOVE: 26; MEMBER_DISCONNECT: 27; BOT_ADD: 28; ROLE_CREATE: 30; ROLE_UPDATE: 31; ROLE_DELETE: 32; INVITE_CREATE: 40; INVITE_UPDATE: 41; INVITE_DELETE: 42; WEBHOOK_CREATE: 50; WEBHOOK_UPDATE: 51; WEBHOOK_DELETE: 52; EMOJI_CREATE: 60; EMOJI_UPDATE: 61; EMOJI_DELETE: 62; MESSAGE_DELETE: 72; MESSAGE_BULK_DELETE: 73; MESSAGE_PIN: 74; MESSAGE_UNPIN: 75; INTEGRATION_CREATE: 80; INTEGRATION_UPDATE: 81; INTEGRATION_DELETE: 82; STAGE_INSTANCE_CREATE: 83; STAGE_INSTANCE_UPDATE: 84; STAGE_INSTANCE_DELETE: 85; STICKER_CREATE: 90; STICKER_UPDATE: 91; STICKER_DELETE: 92; GUILD_SCHEDULED_EVENT_CREATE: 100; GUILD_SCHEDULED_EVENT_UPDATE: 101; GUILD_SCHEDULED_EVENT_DELETE: 102; THREAD_CREATE: 110; THREAD_UPDATE: 111; THREAD_DELETE: 112; APPLICATION_COMMAND_PERMISSION_UPDATE: 121; }; ButtonStyles: { PRIMARY: 1; SECONDARY: 2; SUCCESS: 3; DANGER: 4; LINK: 5; }; ChannelTypes: { GUILD_TEXT: 0; DM: 1; GUILD_VOICE: 2; GROUP_DM: 3; GUILD_CATEGORY: 4; GUILD_NEWS: 5; GUILD_STORE: 6; GUILD_NEWS_THREAD: 10; GUILD_PUBLIC_THREAD: 11; GUILD_PRIVATE_THREAD: 12; GUILD_STAGE_VOICE: 13; /** @deprecated */ GUILD_STAGE: 13; }; ComponentTypes: { ACTION_ROW: 1; BUTTON: 2; SELECT_MENU: 3; }; ConnectionVisibilityTypes: { NONE: 0; EVERYONE: 1; }; DefaultMessageNotificationLevels: { ALL_MESSAGES: 0; ONLY_MENTIONS: 1; }; ExplicitContentFilterLevels: { DISABLED: 0; MEMBERS_WITHOUT_ROLES: 1; ALL_MEMBERS: 2; }; GatewayOPCodes: { DISPATCH: 0; /** @deprecated */ EVENT: 0; HEARTBEAT: 1; IDENTIFY: 2; PRESENCE_UPDATE: 3; /** @deprecated */ STATUS_UPDATE: 3; VOICE_STATE_UPDATE: 4; VOICE_SERVER_PING: 5; RESUME: 6; RECONNECT: 7; REQUEST_GUILD_MEMBERS: 8; /** @deprecated */ GET_GUILD_MEMBERS: 8; INVALID_SESSION: 9; HELLO: 10; HEARTBEAT_ACK: 11; SYNC_GUILD: 12; SYNC_CALL: 13; }; GuildFeatures: [ "ANIMATED_ICON", "BANNER", "COMMERCE", "COMMUNITY", "DISCOVERABLE", "FEATURABLE", "INVITE_SPLASH", "MEMBER_VERIFICATION_GATE_ENABLED", "MONETIZATION_ENABLED", "MORE_STICKERS", "NEWS", "PARTNERED", "PREVIEW_ENABLED", "PRIVATE_THREADS", "ROLE_ICONS", "ROLE_SUBSCRIPTIONS_ENABLED", "SEVEN_DAY_THREAD_ARCHIVE", "THREE_DAY_THREAD_ARCHIVE", "TICKETED_EVENTS_ENABLED", "VANITY_URL", "VERIFIED", "VIP_REGIONS", "WELCOME_SCREEN_ENABLED" ]; GuildIntegrationExpireBehavior: { REMOVE_ROLE: 0; KICK: 1; }; GuildIntegrationTypes: [ "twitch", "youtube", "discord" ]; GuildNSFWLevels: { DEFAULT: 0; EXPLICIT: 1; SAFE: 2; AGE_RESTRICTED: 3; }; ImageFormats: [ "jpg", "jpeg", "png", "webp", "gif" ]; ImageSizeBoundaries: { MAXIMUM: 4096; MINIMUM: 16; }; Intents: { guilds: 1; guildMembers: 2; guildBans: 4; guildEmojisAndStickers: 8; /** @deprecated */ guildEmojis: 8; guildIntegrations: 16; guildWebhooks: 32; guildInvites: 64; guildVoiceStates: 128; guildPresences: 256; guildMessages: 512; guildMessageReactions: 1024; guildMessageTyping: 2048; directMessages: 4096; directMessageReactions: 8192; directMessageTyping: 16384; guildScheduledEvents: 65536; allNonPrivileged: 98045; allPrivileged: 258; all: 98303; }; InteractionResponseTypes: { PONG: 1; CHANNEL_MESSAGE_WITH_SOURCE: 4; DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE: 5; DEFERRED_UPDATE_MESSAGE: 6; UPDATE_MESSAGE: 7; APPLICATION_COMMAND_AUTOCOMPLETE_RESULT: 8; }; InteractionTypes: { PING: 1; APPLICATION_COMMAND: 2; MESSAGE_COMPONENT: 3; APPLICATION_COMMAND_AUTOCOMPLETE: 4; }; InviteTargetTypes: { STREAM: 1; EMBEDDED_APPLICATION: 2; }; MFALevels: { NONE: 0; ELEVATED: 1; }; MessageActivityFlags: { INSTANCE: 1; JOIN: 2; SPECTATE: 4; JOIN_REQUEST: 8; SYNC: 16; PLAY: 32; PARTY_PRIVACY_FRIENDS: 64; PARTY_PRIVACY_VOICE_CHANNEL: 128; EMBEDDED: 256; }; MessageActivityTypes: { JOIN: 1; SPECTATE: 2; LISTEN: 3; JOIN_REQUEST: 5; }; MessageFlags: { CROSSPOSTED: 1; IS_CROSSPOST: 2; SUPPRESS_EMBEDS: 4; SOURCE_MESSAGE_DELETED: 8; URGENT: 16; HAS_THREAD: 32; EPHEMERAL: 64; LOADING: 128; }; MessageTypes: { DEFAULT: 0; RECIPIENT_ADD: 1; RECIPIENT_REMOVE: 2; CALL: 3; CHANNEL_NAME_CHANGE: 4; CHANNEL_ICON_CHANGE: 5; CHANNEL_PINNED_MESSAGE: 6; GUILD_MEMBER_JOIN: 7; USER_PREMIUM_GUILD_SUBSCRIPTION: 8; USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1: 9; USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2: 10; USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3: 11; CHANNEL_FOLLOW_ADD: 12; GUILD_DISCOVERY_DISQUALIFIED: 14; GUILD_DISCOVERY_REQUALIFIED: 15; GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING: 16; GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING: 17; THREAD_CREATED: 18; REPLY: 19; CHAT_INPUT_COMMAND: 20; THREAD_STARTER_MESSAGE: 21; GUILD_INVITE_REMINDER: 22; CONTEXT_MENU_COMMAND: 23; }; PermissionOverwriteTypes: { ROLE: 0; USER: 1; }; Permissions: { createInstantInvite: 1n; kickMembers: 2n; banMembers: 4n; administrator: 8n; manageChannels: 16n; manageGuild: 32n; addReactions: 64n; viewAuditLog: 128n; /** @deprecated */ viewAuditLogs: 128n; voicePrioritySpeaker: 256n; voiceStream: 512n; /** @deprecated */ stream: 512n; viewChannel: 1024n; /** @deprecated */ readMessages: 1024n; sendMessages: 2048n; sendTTSMessages: 4096n; manageMessages: 8192n; embedLinks: 16384n; attachFiles: 32768n; readMessageHistory: 65536n; mentionEveryone: 131072n; useExternalEmojis: 262144n; /** @deprecated */ externalEmojis: 262144n; viewGuildInsights: 524288n; voiceConnect: 1048576n; voiceSpeak: 2097152n; voiceMuteMembers: 4194304n; voiceDeafenMembers: 8388608n; voiceMoveMembers: 16777216n; voiceUseVAD: 33554432n; changeNickname: 67108864n; manageNicknames: 134217728n; manageRoles: 268435456n; manageWebhooks: 536870912n; manageEmojisAndStickers: 1073741824n; /** @deprecated */ manageEmojis: 1073741824n; useApplicationCommands: 2147483648n; /** @deprecated */ useSlashCommands: 2147483648n; voiceRequestToSpeak: 4294967296n; manageEvents: 8589934592n; manageThreads: 17179869184n; createPublicThreads: 34359738368n; createPrivateThreads: 68719476736n; useExternalStickers: 137438953472n; sendMessagesInThreads: 274877906944n; startEmbeddedActivities: 549755813888n; moderateMembers: 1099511627776n; allGuild: 1110182461630n; allText: 535529258065n; allVoice: 554385278737n; all: 2199023255551n; }; PremiumTiers: { NONE: 0; TIER_1: 1; TIER_2: 2; TIER_3: 3; }; PremiumTypes: { NONE: 0; NITRO_CLASSIC: 1; NITRO: 2; }; StageInstancePrivacyLevel: { PUBLIC: 1; GUILD_ONLY: 2; }; StickerFormats: { PNG: 1; APNG: 2; LOTTIE: 3; }; StickerTypes: { STANDARD: 1; GUILD: 2; }; SystemChannelFlags: { SUPPRESS_JOIN_NOTIFICATIONS: 1; SUPPRESS_PREMIUM_SUBSCRIPTIONS: 2; SUPPRESS_GUILD_REMINDER_NOTIFICATIONS: 4; SUPPRESS_JOIN_NOTIFICATION_REPLIES: 8; }; SystemJoinMessages: [ "%user% joined the party.", "%user% is here.", "Welcome, %user%. We hope you brought pizza.", "A wild %user% appeared.", "%user% just landed.", "%user% just slid into the server.", "%user% just showed up!", "Welcome %user%. Say hi!", "%user% hopped into the server.", "Everyone welcome %user%!", "Glad you're here, %user%.", "Good to see you, %user%.", "Yay you made it, %user%!" ]; ThreadMemberFlags: { HAS_INTERACTED: 1; ALL_MESSAGES: 2; ONLY_MENTIONS: 4; NO_MESSAGES: 8; }; UserFlags: { NONE: 0; DISCORD_STAFF: 1; DISCORD_EMPLOYEE: 1; PARTNER: 2; PARTNERED_SERVER_OWNER: 2; /** @deprecated */ DISCORD_PARTNER: 2; HYPESQUAD: 4; HYPESQUAD_EVENTS: 4; BUG_HUNTER_LEVEL_1: 8; HYPESQUAD_ONLINE_HOUSE_1: 64; HOUSE_BRAVERY: 64; HYPESQUAD_ONLINE_HOUSE_2: 128; HOUSE_BRILLIANCE: 128; HYPESQUAD_ONLINE_HOUSE_3: 256; HOUSE_BALANCE: 256; PREMIUM_EARLY_SUPPORTER: 512; EARLY_SUPPORTER: 512; TEAM_PSEUDO_USER: 1024; TEAM_USER: 1024; SYSTEM: 4096; BUG_HUNTER_LEVEL_2: 16384; VERIFIED_BOT: 65536; VERIFIED_DEVELOPER: 131072; VERIFIED_BOT_DEVELOPER: 131072; EARLY_VERIFIED_BOT_DEVELOPER: 131072; CERTIFIED_MODERATOR: 262144; DISCORD_CERTIFIED_MODERATOR: 262144; BOT_HTTP_INTERACTIONS: 524288; }; VerificationLevels: { NONE: 0; LOW: 1; MEDIUM: 2; HIGH: 3; VERY_HIGH: 4; }; VideoQualityModes: { AUTO: 1; FULL: 2; }; VoiceOPCodes: { IDENTIFY: 0; SELECT_PROTOCOL: 1; READY: 2; HEARTBEAT: 3; SESSION_DESCRIPTION: 4; SPEAKING: 5; HEARTBEAT_ACK: 6; RESUME: 7; HELLO: 8; RESUMED: 9; CLIENT_DISCONNECT: 13; /** @deprecated */ DISCONNECT: 13; }; GuildScheduledEventStatus: { SCHEDULED: 1; ACTIVE: 2; COMPLETED: 3; CANCELED: 4; }; GuildScheduledEventEntityTypes: { STAGE_INSTANCE: 1; VOICE: 2; EXTERNAL: 3; }; GuildScheduledEventPrivacyLevel: { PUBLIC: 1; GUILD_ONLY: 2; }; WebhookTypes: { INCOMING: 1; CHANNEL_FOLLOWER: 2; APPLICATION: 3; }; } // Selfbot interface Connection { friend_sync: boolean; id: string; integrations: unknown[]; // TODO ???? name: string; revoked: boolean; type: string; verified: boolean; visibility: ConnectionVisibilityTypes; } interface GuildSettings { channel_override: { channel_id: string; message_notifications: number; muted: boolean; }[]; guild_id: string; message_notifications: number; mobile_push: boolean; muted: boolean; suppress_everyone: boolean; } interface SearchOptions { attachmentExtensions?: string; attachmentFilename?: string; authorID?: string; channelIDs?: string[]; content?: string; contextSize?: number; embedProviders?: string; embedTypes?: string; has?: string; limit?: number; maxID?: string; minID?: string; offset?: number; sortBy?: string; sortOrder?: string; } interface SearchResults { results: (Message & { hit?: boolean })[][]; totalResults: number; } interface UserProfile { connected_accounts: { id: string; name: string; type: string; verified: boolean }[]; mutual_guilds: { id: string; nick?: string }[]; premium_since?: number; user: PartialUser & { flags: number }; } interface UserSettings { afk_timeout: number; convert_emojis: boolean; default_guilds_restricted: boolean; detect_platform_accounts: boolean; developer_mode: boolean; enable_tts_command: boolean; explicit_content_filter: number; friend_source_flags: { all: boolean; // not sure about other keys, abal heeeelp }; inline_attachment_media: boolean; inline_embed_media: boolean; guild_positions: string[]; locale: string; message_display_compact: boolean; render_embeds: boolean; render_reactions: boolean; restricted_guilds: string[]; show_current_game: boolean; status: string; theme: string; } class Base implements SimpleJSON { createdAt: number; id: string; constructor(id: string); static getCreatedAt(id: string): number; static getDiscordEpoch(id: string): number; inspect(): this; toString(): string; toJSON(props?: string[]): JSONCache; } export class Bucket { interval: number; lastReset: number; lastSend: number; tokenLimit: number; tokens: number; constructor(tokenLimit: number, interval: number, options: { latencyRef: { latency: number }; reservedTokens: number }); check(): void; queue(func: () => void, priority?: boolean): void; } export class BrowserWebSocket extends EventEmitter { static CONNECTING: 0; static OPEN: 1; static CLOSING: 2; static CLOSED: 3; readyState: number; constructor(url: string); close(code?: number, reason?: string): void; removeEventListener(event: string | symbol, listener: (...args: any[]) => void): this; // @ts-ignore: DOM send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void; terminate(): void; } export class BrowserWebSocketError extends Error { // @ts-ignore: DOM event: Event; // @ts-ignore: DOM constructor(message: string, event: Event); } export class Call extends Base { channel: GroupChannel; createdAt: number; endedTimestamp: number | null; id: string; participants: string[]; region: string | null; ringing: string[]; unavailable: boolean; voiceStates: Collection; constructor(data: BaseData, channel: GroupChannel); } export class CategoryChannel extends GuildChannel { channels: Collection>; type: Constants["ChannelTypes"]["GUILD_CATEGORY"]; edit(options: Omit, reason?: string): Promise; } export class Channel extends Base { client: Client; createdAt: number; id: string; mention: string; type: ChannelTypes; constructor(data: BaseData, client: Client); static from(data: BaseData, client: Client): AnyChannel; } export class Client extends EventEmitter { application?: { id: string; flags: number }; bot: boolean; channelGuildMap: { [s: string]: string }; gatewayURL?: string; groupChannels: Collection; guilds: Collection; guildShardMap: { [s: string]: number }; lastConnect: number; lastReconnectDelay: number; notes: { [s: string]: string }; options: ClientOptions; presence: ClientPresence; privateChannelMap: { [s: string]: string }; privateChannels: Collection; ready: boolean; reconnectAttempts: number; relationships: Collection; requestHandler: RequestHandler; shards: ShardManager; startTime: number; threadGuildMap: { [s: string]: string }; unavailableGuilds: Collection; uptime: number; user: ExtendedUser; userGuildSettings: { [s: string]: GuildSettings }; users: Collection; userSettings: UserSettings; voiceConnections: VoiceConnectionManager; constructor(token: string, options?: ClientOptions); acceptInvite(inviteID: string): Promise>; addGroupRecipient(groupID: string, userID: string): Promise; addGuildDiscoverySubcategory(guildID: string, categoryID: string, reason?: string): Promise; addGuildMember(guildID: string, userID: string, accessToken: string, options?: AddGuildMemberOptions): Promise; addGuildMemberRole(guildID: string, memberID: string, roleID: string, reason?: string): Promise; addMessageReaction(channelID: string, messageID: string, reaction: string): Promise; /** @deprecated */ addMessageReaction(channelID: string, messageID: string, reaction: string, userID: string): Promise; addRelationship(userID: string, block?: boolean): Promise; addSelfPremiumSubscription(token: string, plan: string): Promise; banGuildMember(guildID: string, userID: string, deleteMessageDays?: number, reason?: string): Promise; bulkEditCommandPermissions(guildID: string, permissions: { id: string; permissions: ApplicationCommandPermissions[] }[]): Promise; bulkEditCommands(commands: ApplicationCommandStructure[]): Promise; bulkEditGuildCommands(guildID: string, commands: ApplicationCommandStructure[]): Promise; closeVoiceConnection(guildID: string): void; connect(): Promise; createChannel(guildID: string, name: string): Promise; createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_TEXT"], options?: CreateChannelOptions ): Promise; createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_VOICE"], options?: CreateChannelOptions ): Promise; createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_CATEGORY"], options?: CreateChannelOptions ): Promise; createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_NEWS"], options?: CreateChannelOptions ): Promise; createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_STORE"], options?: CreateChannelOptions ): Promise; createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_STAGE"], options?: CreateChannelOptions ): Promise; createChannel( guildID: string, name: string, type?: number, options?: CreateChannelOptions ): Promise; /** @deprecated */ createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_TEXT"], reason?: string, options?: CreateChannelOptions | string ): Promise; /** @deprecated */ createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_VOICE"], reason?: string, options?: CreateChannelOptions | string ): Promise; /** @deprecated */ createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_CATEGORY"], reason?: string, options?: CreateChannelOptions | string ): Promise; /** @deprecated */ createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_NEWS"], reason?: string, options?: CreateChannelOptions | string ): Promise; /** @deprecated */ createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_STORE"], reason?: string, options?: CreateChannelOptions | string ): Promise; /** @deprecated */ createChannel( guildID: string, name: string, type: Constants["ChannelTypes"]["GUILD_STAGE"], reason?: string, options?: CreateChannelOptions | string ): Promise; /** @deprecated */ createChannel( guildID: string, name: string, type?: number, reason?: string, options?: CreateChannelOptions | string ): Promise; createChannelInvite( channelID: string, options?: CreateChannelInviteOptions, reason?: string ): Promise>; createChannelWebhook( channelID: string, options: { name: string; avatar?: string | null }, reason?: string ): Promise; createCommand(command: ApplicationCommandStructure): Promise; createGroupChannel(userIDs: string[]): Promise; createGuild(name: string, options?: CreateGuildOptions): Promise; createGuildCommand(guildID: string, command: ApplicationCommandStructure): Promise; createGuildEmoji(guildID: string, options: EmojiOptions, reason?: string): Promise; createGuildFromTemplate(code: string, name: string, icon?: string): Promise; createGuildScheduledEvent(guildID: string, event: GuildScheduledEventOptions, reason?: string): Promise>; createGuildSticker(guildID: string, options: CreateStickerOptions, reason?: string): Promise; createGuildTemplate(guildID: string, name: string, description?: string | null): Promise; createInteractionResponse(interactionID: string, interactionToken: string, options: InteractionOptions, file?: FileContent | FileContent[]): Promise; createMessage(channelID: string, content: MessageContent, file?: FileContent | FileContent[]): Promise; createRole(guildID: string, options?: RoleOptions, reason?: string): Promise; createRole(guildID: string, options?: Role, reason?: string): Promise; createStageInstance(channelID: string, options: StageInstanceOptions): Promise; createThreadWithMessage(channelID: string, messageID: string, options: CreateThreadOptions): Promise; createThreadWithoutMessage(channelID: string, options: CreateThreadWithoutMessageOptions): Promise; crosspostMessage(channelID: string, messageID: string): Promise; deleteChannel(channelID: string, reason?: string): Promise; deleteChannelPermission(channelID: string, overwriteID: string, reason?: string): Promise; deleteCommand(commandID: string): Promise; deleteGuild(guildID: string): Promise; deleteGuildCommand(guildID: string, commandID: string): Promise; deleteGuildDiscoverySubcategory(guildID: string, categoryID: string, reason?: string): Promise; deleteGuildEmoji(guildID: string, emojiID: string, reason?: string): Promise; deleteGuildIntegration(guildID: string, integrationID: string): Promise; deleteGuildScheduledEvent(guildID: string, eventID: string): Promise; deleteGuildSticker(guildID: string, stickerID: string, reason?: string): Promise; deleteGuildTemplate(guildID: string, code: string): Promise; deleteInvite(inviteID: string, reason?: string): Promise; deleteMessage(channelID: string, messageID: string, reason?: string): Promise; deleteMessages(channelID: string, messageIDs: string[], reason?: string): Promise; deleteRole(guildID: string, roleID: string, reason?: string): Promise; deleteSelfConnection(platform: string, id: string): Promise; deleteSelfPremiumSubscription(): Promise; deleteStageInstance(channelID: string): Promise; deleteUserNote(userID: string): Promise; deleteWebhook(webhookID: string, token?: string, reason?: string): Promise; deleteWebhookMessage(webhookID: string, token: string, messageID: string): Promise; disableSelfMFATOTP(code: string): Promise<{ token: string }>; disconnect(options: { reconnect?: boolean | "auto" }): void; editAFK(afk: boolean): void; editChannel( channelID: string, options: EditChannelOptions, reason?: string ): Promise; editChannelPermission( channelID: string, overwriteID: string, allow: bigint | number, deny: bigint | number, type: PermissionType, reason?: string ): Promise; editChannelPosition(channelID: string, position: number, options?: EditChannelPositionOptions): Promise; editChannelPositions(guildID: string, channelPositions: ChannelPosition[]): Promise; editCommand(commandID: string, command: ApplicationCommandStructure): Promise; editCommandPermissions(guildID: string, commandID: string, permissions: ApplicationCommandPermissions[]): Promise; editGuild(guildID: string, options: GuildOptions, reason?: string): Promise; editGuildCommand(guildID: string, commandID: string, command: ApplicationCommandStructure): Promise; editGuildDiscovery(guildID: string, options?: DiscoveryOptions): Promise; editGuildEmoji( guildID: string, emojiID: string, options: { name?: string; roles?: string[] }, reason?: string ): Promise; editGuildIntegration(guildID: string, integrationID: string, options: IntegrationOptions): Promise; editGuildMember(guildID: string, memberID: string, options: MemberOptions, reason?: string): Promise; editGuildScheduledEvent(guildID: string, eventID: string, event: GuildScheduledEventEditOptions, reason?: string): Promise>; editGuildSticker(guildID: string, stickerID: string, options?: EditStickerOptions, reason?: string): Promise; editGuildTemplate(guildID: string, code: string, options: GuildTemplateOptions): Promise; editGuildVanity(guildID: string, code: string | null): Promise; editGuildVoiceState(guildID: string, options: VoiceStateOptions, userID?: string): Promise; editGuildWelcomeScreen(guildID: string, options: WelcomeScreenOptions): Promise; editGuildWidget(guildID: string, options: Widget): Promise; editMessage(channelID: string, messageID: string, content: MessageContentEdit): Promise; /** @deprecated */ editNickname(guildID: string, nick: string, reason?: string): Promise; editRole(guildID: string, roleID: string, options: RoleOptions, reason?: string): Promise; // TODO not all options are available? editRolePosition(guildID: string, roleID: string, position: number): Promise; editSelf(options: { avatar?: string; username?: string }): Promise; editSelfConnection( platform: string, id: string, data: { friendSync: boolean; visibility: number } ): Promise; editSelfSettings(data: UserSettings): Promise; editStageInstance(channelID: string, options: StageInstanceOptions): Promise; editStatus(status: SelfStatus, activities?: ActivityPartial[] | ActivityPartial): void; editStatus(activities?: ActivityPartial[] | ActivityPartial): void; editUserNote(userID: string, note: string): Promise; editWebhook( webhookID: string, options: WebhookOptions, token?: string, reason?: string ): Promise; editWebhookMessage( webhookID: string, token: string, messageID: string, options: MessageWebhookContent ): Promise>; emit(event: K, ...args: ClientEvents[K]): boolean; emit(event: string, ...args: any[]): boolean; enableSelfMFATOTP( secret: string, code: string ): Promise<{ backup_codes: { code: string; consumed: boolean }[]; token: string }>; executeSlackWebhook(webhookID: string, token: string, options: Record & { auth?: boolean; threadID?: string }): Promise; executeSlackWebhook(webhookID: string, token: string, options: Record & { auth?: boolean; threadID?: string; wait: true }): Promise>; executeWebhook(webhookID: string, token: string, options: WebhookPayload & { wait: true }): Promise>; executeWebhook(webhookID: string, token: string, options: WebhookPayload): Promise; followChannel(channelID: string, webhookChannelID: string): Promise; getActiveGuildThreads(guildID: string): Promise; /** @deprecated */ getActiveThreads(channelID: string): Promise; getArchivedThreads(channelID: string, type: "private", options?: GetArchivedThreadsOptions): Promise>; getArchivedThreads(channelID: string, type: "public", options?: GetArchivedThreadsOptions): Promise>; getBotGateway(): Promise<{ session_start_limit: { max_concurrency: number; remaining: number; reset_after: number; total: number }; shards: number; url: string }>; getChannel(channelID: string): AnyChannel; getChannelInvites(channelID: string): Promise; getChannelWebhooks(channelID: string): Promise; getCommand(commandID: string): Promise; getCommandPermissions(guildID: string, commandID: string): Promise; getCommands(): Promise; getDiscoveryCategories(): Promise; getDMChannel(userID: string): Promise; getEmojiGuild(emojiID: string): Promise; getGateway(): Promise<{ url: string }>; getGuildAuditLog(guildID: string, options?: GetGuildAuditLogOptions): Promise; /** @deprecated */ getGuildAuditLogs(guildID: string, limit?: number, before?: string, actionType?: number, userID?: string): Promise; getGuildBan(guildID: string, userID: string): Promise; getGuildBans(guildID: string, options?: GetGuildBansOptions): Promise; getGuildCommand(guildID: string, commandID: string): Promise; getGuildCommandPermissions(guildID: string): Promise; getGuildCommands(guildID: string): Promise; getGuildDiscovery(guildID: string): Promise; /** @deprecated */ getGuildEmbed(guildID: string): Promise; getGuildIntegrations(guildID: string): Promise; getGuildInvites(guildID: string): Promise; getGuildPreview(guildID: string): Promise; getGuildScheduledEvents(guildID: string, options?: GetGuildScheduledEventOptions): Promise getGuildScheduledEventUsers(guildID: string, eventID: string, options?: GetGuildScheduledEventUsersOptions): Promise; getGuildTemplate(code: string): Promise; getGuildTemplates(guildID: string): Promise; getGuildVanity(guildID: string): Promise; getGuildWebhooks(guildID: string): Promise; getGuildWelcomeScreen(guildID: string): Promise; getGuildWidget(guildID: string): Promise; getGuildWidgetSettings(guildID: string): Promise; getInvite(inviteID: string, withCounts?: false): Promise>; getInvite(inviteID: string, withCounts: true): Promise>; getJoinedPrivateArchivedThreads(channelID: string, options?: GetArchivedThreadsOptions): Promise>; getMessage(channelID: string, messageID: string): Promise; getMessageReaction(channelID: string, messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise; /** @deprecated */ getMessageReaction(channelID: string, messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise; getMessages(channelID: string, options?: GetMessagesOptions): Promise; /** @deprecated */ getMessages(channelID: string, limit?: number, before?: string, after?: string, around?: string): Promise; getNitroStickerPacks(): Promise<{ sticker_packs: StickerPack[] }>; getOAuthApplication(appID?: string): Promise; getPins(channelID: string): Promise; getPruneCount(guildID: string, options?: GetPruneOptions): Promise; getRESTChannel(channelID: string): Promise; getRESTGuild(guildID: string, withCounts?: boolean): Promise; getRESTGuildChannels(guildID: string): Promise; getRESTGuildEmoji(guildID: string, emojiID: string): Promise; getRESTGuildEmojis(guildID: string): Promise; getRESTGuildMember(guildID: string, memberID: string): Promise; getRESTGuildMembers(guildID: string, options?: GetRESTGuildMembersOptions): Promise; /** @deprecated */ getRESTGuildMembers(guildID: string, limit?: number, after?: string): Promise; getRESTGuildRoles(guildID: string): Promise; getRESTGuilds(options?: GetRESTGuildsOptions): Promise; /** @deprecated */ getRESTGuilds(limit?: number, before?: string, after?: string): Promise; getRESTGuildScheduledEvent(guildID: string, eventID: string, options?: GetGuildScheduledEventOptions): Promise; getRESTGuildSticker(guildID: string, stickerID: string): Promise; getRESTGuildStickers(guildID: string): Promise; getRESTSticker(stickerID: string): Promise; getRESTUser(userID: string): Promise; getSelf(): Promise; getSelfBilling(): Promise<{ payment_gateway?: string; payment_source?: { brand: string; expires_month: number; expires_year: number; invalid: boolean; last_4: number; type: string; }; premium_subscription?: { canceled_at?: string; created_at: string; current_period_end?: string; current_period_start?: string; ended_at?: string; plan: string; status: number; }; }>; getSelfConnections(): Promise; getSelfMFACodes( password: string, regenerate?: boolean ): Promise<{ backup_codes: { code: string; consumed: boolean }[] }>; getSelfPayments(): Promise<{ amount: number; amount_refunded: number; created_at: string; // date currency: string; description: string; status: number; }[]>; getSelfSettings(): Promise; getStageInstance(channelID: string): Promise; getThreadMembers(channelID: string): Promise; getUserProfile(userID: string): Promise; getVoiceRegions(guildID?: string): Promise; getWebhook(webhookID: string, token?: string): Promise; getWebhookMessage(webhookID: string, token: string, messageID: string): Promise>; joinThread(channelID: string, userID?: string): Promise; joinVoiceChannel(channelID: string, options?: JoinVoiceChannelOptions): Promise; kickGuildMember(guildID: string, userID: string, reason?: string): Promise; leaveGuild(guildID: string): Promise; leaveThread(channelID: string, userID?: string): Promise; leaveVoiceChannel(channelID: string): void; off(event: K, listener: (...args: ClientEvents[K]) => void): this; off(event: string, listener: (...args: any[]) => void): this; once(event: K, listener: (...args: ClientEvents[K]) => void): this; once(event: string, listener: (...args: any[]) => void): this; pinMessage(channelID: string, messageID: string): Promise; pruneMembers(guildID: string, options?: PruneMemberOptions): Promise; purgeChannel(channelID: string, options: PurgeChannelOptions): Promise; /** @deprecated */ purgeChannel( channelID: string, limit?: number, filter?: (m: Message) => boolean, before?: string, after?: string, reason?: string ): Promise; removeGroupRecipient(groupID: string, userID: string): Promise; removeGuildMemberRole(guildID: string, memberID: string, roleID: string, reason?: string): Promise; removeMessageReaction(channelID: string, messageID: string, reaction: string, userID?: string): Promise; removeMessageReactionEmoji(channelID: string, messageID: string, reaction: string): Promise; removeMessageReactions(channelID: string, messageID: string): Promise; removeRelationship(userID: string): Promise; searchChannelMessages(channelID: string, query: SearchOptions): Promise; searchGuildMembers(guildID: string, query: string, limit?: number): Promise; searchGuildMessages(guildID: string, query: SearchOptions): Promise; sendChannelTyping(channelID: string): Promise; syncGuildIntegration(guildID: string, integrationID: string): Promise; syncGuildTemplate(guildID: string, code: string): Promise; unbanGuildMember(guildID: string, userID: string, reason?: string): Promise; unpinMessage(channelID: string, messageID: string): Promise; validateDiscoverySearchTerm(term: string): Promise<{ valid: boolean }>; on(event: K, listener: (...args: ClientEvents[K]) => void): this; on(event: string, listener: (...args: any[]) => void): this; toString(): string; } export class Collection extends Map { baseObject: new (...args: any[]) => T; limit?: number; constructor(baseObject: new (...args: any[]) => T, limit?: number); add(obj: T, extra?: unknown, replace?: boolean): T; every(func: (i: T) => boolean): boolean; filter(func: (i: T) => boolean): T[]; find(func: (i: T) => boolean): T | undefined; map(func: (i: T) => R): R[]; random(): T | undefined; reduce(func: (accumulator: U, val: T) => U, initialValue?: U): U; remove(obj: T | Uncached): T | null; some(func: (i: T) => boolean): boolean; update(obj: T, extra?: unknown, replace?: boolean): T; } export class Command implements CommandOptions, SimpleJSON { aliases: string[]; argsRequired: boolean; caseInsensitive: boolean; cooldown: number; cooldownExclusions: CommandCooldownExclusions; cooldownMessage: MessageContent | false | GenericCheckFunction; cooldownReturns: number; defaultSubcommandOptions: CommandOptions; deleteCommand: boolean; description: string; dmOnly: boolean; errorMessage: MessageContent | GenericCheckFunction; fullDescription: string; fullLabel: string; guildOnly: boolean; hidden: boolean; hooks: Hooks; invalidUsageMessage: MessageContent | false | GenericCheckFunction; label: string; parentCommand?: Command; permissionMessage: MessageContent | false | GenericCheckFunction; reactionButtons: null | CommandReactionButtons[]; reactionButtonTimeout: number; requirements: CommandRequirements; restartCooldown: boolean; subcommandAliases: { [alias: string]: string }; subcommands: { [s: string]: Command }; usage: string; constructor(label: string, generate: CommandGenerator, options?: CommandOptions); cooldownCheck(msg: Message): boolean; cooldownExclusionCheck(msg: Message): boolean; executeCommand(msg: Message, args: string[]): Promise; permissionCheck(msg: Message): Promise; process(args: string[], msg: Message): Promise; registerSubcommand(label: string, generator: CommandGenerator, options?: CommandOptions): Command; registerSubcommandAlias(alias: string, label: string): void; unregisterSubcommand(label: string): void; toString(): string; toJSON(props?: string[]): JSONCache; } export class CommandClient extends Client { activeMessages: { [s: string]: ActiveMessages }; commandAliases: { [s: string]: string }; commandOptions: CommandClientOptions; commands: { [s: string]: Command }; guildPrefixes: { [s: string]: string | string[] }; preReady?: true; constructor(token: string, options: ClientOptions, commandOptions?: CommandClientOptions); checkPrefix(msg: Message): string; onMessageCreate(msg: Message): Promise; onMessageReactionEvent(msg: Message, emoji: Emoji, reactor: Member | Uncached | string): Promise registerCommand(label: string, generator: CommandGenerator, options?: CommandOptions): Command; registerCommandAlias(alias: string, label: string): void; registerGuildPrefix(guildID: string, prefix: string[] | string): void; resolveCommand(label: string): Command; unregisterCommand(label: string): void; unwatchMessage(id: string, channelID: string): void; toString(): string; } export class DiscordHTTPError extends Error { code: number; headers: IncomingHttpHeaders; name: "DiscordHTTPError"; req: ClientRequest; res: IncomingMessage; response: HTTPResponse; constructor(req: ClientRequest, res: IncomingMessage, response: HTTPResponse, stack: string); flattenErrors(errors: HTTPResponse, keyPrefix?: string): string[]; } export class DiscordRESTError extends Error { code: number; headers: IncomingHttpHeaders; name: string; req: ClientRequest; res: IncomingMessage; response: HTTPResponse; constructor(req: ClientRequest, res: IncomingMessage, response: HTTPResponse, stack: string); flattenErrors(errors: HTTPResponse, keyPrefix?: string): string[]; } export class ExtendedUser extends User { email: string; mfaEnabled: boolean; premiumType: PremiumTypes; verified: boolean; } export class GroupChannel extends PrivateChannel { icon: string | null; iconURL: string | null; name: string; ownerID: string; recipients: Collection; type: Constants["ChannelTypes"]["GROUP_DM"]; addRecipient(userID: string): Promise; dynamicIconURL(format?: ImageFormat, size?: number): string | null; edit(options: { icon?: string; name?: string; ownerID?: string }): Promise; removeRecipient(userID: string): Promise; } export class Guild extends Base { afkChannelID: string | null; afkTimeout: number; applicationID: string | null; approximateMemberCount?: number; approximatePresenceCount?: number; autoRemoved?: boolean; banner: string | null; bannerURL: string | null; channels: Collection; createdAt: number; defaultNotifications: DefaultNotifications; description: string | null; discoverySplash: string | null; discoverySplashURL: string | null; emojiCount?: number; emojis: Emoji[]; events: Collection; explicitContentFilter: ExplicitContentFilter; features: GuildFeatures[]; icon: string | null; iconURL: string | null; id: string; joinedAt: number; large: boolean; maxMembers: number; maxPresences?: number | null; maxVideoChannelUsers?: number; memberCount: number; members: Collection; mfaLevel: MFALevel; name: string; /** @deprecated */ nsfw: boolean; nsfwLevel: NSFWLevel; ownerID: string; preferredLocale: string; premiumProgressBarEnabled: boolean; premiumSubscriptionCount?: number; premiumTier: PremiumTier; primaryCategory?: DiscoveryCategory; primaryCategoryID?: number; publicUpdatesChannelID: string; roles: Collection; rulesChannelID: string | null; shard: Shard; splash: string | null; splashURL: string | null; stageInstances: Collection; stickers?: Sticker[]; systemChannelFlags: number; systemChannelID: string | null; threads: Collection; unavailable: boolean; vanityURL: string | null; verificationLevel: VerificationLevel; voiceStates: Collection; welcomeScreen?: WelcomeScreen; widgetChannelID?: string | null; widgetEnabled?: boolean | null; constructor(data: BaseData, client: Client); addDiscoverySubcategory(categoryID: string, reason?: string): Promise; addMember(userID: string, accessToken: string, options?: AddGuildMemberOptions): Promise; addMemberRole(memberID: string, roleID: string, reason?: string): Promise; banMember(userID: string, deleteMessageDays?: number, reason?: string): Promise; bulkEditCommands(commands: ApplicationCommandStructure[]): Promise; createChannel(name: string): Promise; createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_TEXT"], options?: CreateChannelOptions): Promise; createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_VOICE"], options?: CreateChannelOptions): Promise; createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_CATEGORY"], options?: CreateChannelOptions): Promise; createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_NEWS"], options?: CreateChannelOptions | string): Promise; createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_STORE"], options?: CreateChannelOptions | string): Promise; createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_STAGE"], options?: CreateChannelOptions | string): Promise; createChannel(name: string, type?: number, options?: CreateChannelOptions): Promise; /** @deprecated */ createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_TEXT"], reason?: string, options?: CreateChannelOptions | string): Promise; /** @deprecated */ createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_VOICE"], reason?: string, options?: CreateChannelOptions | string): Promise; /** @deprecated */ createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_CATEGORY"], reason?: string, options?: CreateChannelOptions | string): Promise; /** @deprecated */ createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_NEWS"], reason?: string, options?: CreateChannelOptions | string): Promise; /** @deprecated */ createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_STORE"], reason?: string, options?: CreateChannelOptions | string): Promise; /** @deprecated */ createChannel(name: string, type: Constants["ChannelTypes"]["GUILD_STAGE"], reason?: string, options?: CreateChannelOptions | string): Promise; /** @deprecated */ createChannel(name: string, type?: number, reason?: string, options?: CreateChannelOptions | string): Promise; createCommand(command: ApplicationCommandStructure): Promise; createEmoji(options: { image: string; name: string; roles?: string[] }, reason?: string): Promise; createRole(options: RoleOptions, reason?: string): Promise; createRole(options: Role, reason?: string): Promise; createScheduledEvent(event: GuildScheduledEventOptions, reason?: string): Promise>; createSticker(options: CreateStickerOptions, reason?: string): Promise; createTemplate(name: string, description?: string | null): Promise; delete(): Promise; deleteCommand(commandID: string): Promise; deleteDiscoverySubcategory(categoryID: string, reason?: string): Promise; deleteEmoji(emojiID: string, reason?: string): Promise; deleteIntegration(integrationID: string): Promise; deleteRole(roleID: string): Promise; deleteScheduledEvent(eventID: string): Promise; deleteSticker(stickerID: string, reason?: string): Promise; deleteTemplate(code: string): Promise; dynamicBannerURL(format?: ImageFormat, size?: number): string | null; dynamicDiscoverySplashURL(format?: ImageFormat, size?: number): string | null; dynamicIconURL(format?: ImageFormat, size?: number): string | null; dynamicSplashURL(format?: ImageFormat, size?: number): string | null; edit(options: GuildOptions, reason?: string): Promise; editChannelPositions(channelPositions: ChannelPosition[]): Promise; editCommand(commandID: string, command: ApplicationCommandStructure): Promise; editCommandPermissions(permissions: ApplicationCommandPermissions[]): Promise; editDiscovery(options?: DiscoveryOptions): Promise; editEmoji(emojiID: string, options: { name: string; roles?: string[] }, reason?: string): Promise; editIntegration(integrationID: string, options: IntegrationOptions): Promise; editMember(memberID: string, options: MemberOptions, reason?: string): Promise; /** @deprecated */ editNickname(nick: string): Promise; editRole(roleID: string, options: RoleOptions): Promise; editScheduledEvent(eventID: string, event: GuildScheduledEventEditOptions, reason?: string): Promise> editSticker(stickerID: string, options?: EditStickerOptions, reason?: string): Promise; editTemplate(code: string, options: GuildTemplateOptions): Promise; editVanity(code: string | null): Promise; editVoiceState(options: VoiceStateOptions, userID?: string): Promise; editWelcomeScreen(options: WelcomeScreenOptions): Promise; editWidget(options: Widget): Promise; fetchAllMembers(timeout?: number): Promise; fetchMembers(options?: FetchMembersOptions): Promise; getActiveThreads(): Promise; getAuditLog(options?: GetGuildAuditLogOptions): Promise; /** @deprecated */ getAuditLogs(limit?: number, before?: string, actionType?: number, userID?: string): Promise; getBan(userID: string): Promise; getBans(options?: GetGuildBansOptions): Promise; getCommand(commandID: string): Promise; getCommandPermissions(): Promise; getCommands(): Promise; getDiscovery(): Promise; /** @deprecated */ getEmbed(): Promise; getIntegrations(): Promise; getInvites(): Promise; getPruneCount(options?: GetPruneOptions): Promise; getRESTChannels(): Promise; getRESTEmoji(emojiID: string): Promise; getRESTEmojis(): Promise; getRESTMember(memberID: string): Promise; getRESTMembers(options?: GetRESTGuildMembersOptions): Promise; /** @deprecated */ getRESTMembers(limit?: number, after?: string): Promise; getRESTRoles(): Promise; getRESTScheduledEvent(eventID: string): Promise; getRESTSticker(stickerID: string): Promise; getRESTStickers(): Promise; getScheduledEvents(options?: GetGuildScheduledEventOptions): Promise; getScheduledEventUsers(eventID: string, options?: GetGuildScheduledEventUsersOptions): Promise; getTemplates(): Promise; getVanity(): Promise; getVoiceRegions(): Promise; getWebhooks(): Promise; getWelcomeScreen(): Promise; getWidget(): Promise; getWidgetSettings(): Promise; kickMember(userID: string, reason?: string): Promise; leave(): Promise; leaveVoiceChannel(): void; permissionsOf(memberID: string | Member | MemberRoles): Permission; pruneMembers(options?: PruneMemberOptions): Promise; removeMemberRole(memberID: string, roleID: string, reason?: string): Promise; searchMembers(query: string, limit?: number): Promise; syncIntegration(integrationID: string): Promise; syncTemplate(code: string): Promise; unbanMember(userID: string, reason?: string): Promise; } export class GuildAuditLogEntry extends Base { actionType: number; after: { [key: string]: unknown } | null; before: { [key: string]: unknown } | null; channel?: AnyGuildChannel; count?: number; deleteMemberDays?: number; guild: Guild; id: string; member?: Member | Uncached; membersRemoved?: number; message?: Message; reason: string | null; role?: Role | { id: string; name: string }; target?: Guild | AnyGuildChannel | Member | Role | Invite | Emoji | Sticker | Message | null; targetID: string; user: User; constructor(data: BaseData, guild: Guild); } export class GuildChannel extends Channel { guild: Guild; name: string; nsfw: boolean; parentID: string | null; permissionOverwrites: Collection; position: number; type: GuildChannelTypes; constructor(data: BaseData, client: Client); delete(reason?: string): Promise; deletePermission(overwriteID: string, reason?: string): Promise; edit(options: Omit, reason?: string): Promise; editPermission( overwriteID: string, allow: bigint | number, deny: bigint | number, type: PermissionType, reason?: string ): Promise; editPosition(position: number, options?: EditChannelPositionOptions): Promise; getInvites(): Promise; permissionsOf(memberID: string | Member | MemberRoles): Permission; } export class GuildScheduledEvent extends Base { channelID: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? null : PossiblyUncachedSpeakableChannel; creator?: User; description?: string; entityID: string | null; entityMetadata: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Required : null; entityType: T; guild: PossiblyUncachedGuild; id: string; image?: string; name: string; privacyLevel: GuildScheduledEventPrivacyLevel; scheduledEndTime: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? number : number | null; scheduledStartTime: number; status: GuildScheduledEventStatus; userCount?: number; delete(): Promise; edit(event: GuildScheduledEventEditOptions, reason?: string): Promise>; getUsers(options?: GetGuildScheduledEventUsersOptions): Promise; } export class GuildIntegration extends Base { account: { id: string; name: string }; application?: IntegrationApplication; createdAt: number; enabled: boolean; enableEmoticons?: boolean; expireBehavior?: GuildIntegrationExpireBehavior; expireGracePeriod?: number; id: string; name: string; revoked?: boolean; roleID?: string; subscriberCount?: number; syncedAt?: number; syncing?: boolean; type: GuildIntegrationTypes; user?: User; constructor(data: BaseData, guild: Guild); delete(): Promise; edit(options: IntegrationOptions): Promise; sync(): Promise; } export class GuildPreview extends Base { approximateMemberCount: number; approximatePresenceCount: number; description: string | null; discoverySplash: string | null; discoverySplashURL: string | null; emojis: Emoji[]; features: GuildFeatures[]; icon: string | null; iconURL: string | null; id: string; name: string; splash: string | null; splashURL: string | null; constructor(data: BaseData, client: Client); dynamicDiscoverySplashURL(format?: ImageFormat, size?: number): string | null; dynamicIconURL(format?: ImageFormat, size?: number): string | null; dynamicSplashURL(format?: ImageFormat, size?: number): string | null; } export class GuildTemplate { code: string; createdAt: number; creator: User; description: string | null; isDirty: string | null; name: string; serializedSourceGuild: Guild; sourceGuild: Guild | Uncached; updatedAt: number; usageCount: number; constructor(data: BaseData, client: Client); createGuild(name: string, icon?: string): Promise; delete(): Promise; edit(options: GuildTemplateOptions): Promise; sync(): Promise; toJSON(props?: string[]): JSONCache; } export class TextVoiceChannel extends VoiceChannel implements GuildTextable { lastMessageID: string; messages: Collection>; rateLimitPerUser: number; addMessageReaction(messageID: string, reaction: string): Promise; /** @deprecated */ addMessageReaction(messageID: string, reaction: string, userID: string): Promise; createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise>; createWebhook(options: { name: string; avatar?: string | null }, reason?: string): Promise; deleteMessage(messageID: string, reason?: string): Promise; deleteMessages(messageIDs: string[], reason?: string): Promise; editMessage(messageID: string, content: MessageContentEdit): Promise>; getMessage(messageID: string): Promise>; getMessageReaction(messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise; /** @deprecated */ getMessageReaction(messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise; getMessages(options?: GetMessagesOptions): Promise[]>; /** @deprecated */ getMessages(limit?: number, before?: string, after?: string, around?: string): Promise; getWebhooks(): Promise; purge(options: PurgeChannelOptions): Promise; removeMessageReaction(messageID: string, reaction: string, userID?: string): Promise; removeMessageReactionEmoji(messageID: string, reaction: string): Promise; removeMessageReactions(messageID: string): Promise; sendTyping(): Promise; unsendMessage(messageID: string): Promise; } export class Interaction extends Base { acknowledged: boolean; applicationID: string; id: string; token: string; type: number; version: number; static from(data: BaseData): AnyInteraction; } export class PingInteraction extends Interaction { type: Constants["InteractionTypes"]["PING"]; acknowledge(): Promise; pong(): Promise; } export class CommandInteraction extends Interaction { appPermissions?: Permission; channel: T; data: { id: string; name: string; type: ApplicationCommandTypes; target_id?: string; resolved?: { users?: Collection; members?: Collection>; roles?: Collection; channels?: Collection; messages?: Collection; }; options?: InteractionDataOptions[]; }; guildID?: string; member?: Member; type: Constants["InteractionTypes"]["APPLICATION_COMMAND"]; user?: User; acknowledge(flags?: number): Promise; createFollowup(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise; createMessage(content: string | InteractionContent , file?: FileContent | FileContent[]): Promise; defer(flags?: number): Promise; deleteMessage(messageID: string): Promise; deleteOriginalMessage(): Promise; editMessage(messageID: string, content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise; editOriginalMessage(content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise; getOriginalMessage(): Promise } interface ComponentInteractionButtonData { component_type: Constants["ComponentTypes"]["BUTTON"]; custom_id: string; } interface ComponentInteractionSelectMenuData { component_type: Constants["ComponentTypes"]["SELECT_MENU"]; custom_id: string; values: string[]; } export class ComponentInteraction extends Interaction { appPermissions?: Permission; channel: T; data: ComponentInteractionButtonData | ComponentInteractionSelectMenuData; guildID?: string; member?: Member; message: Message; type: Constants["InteractionTypes"]["MESSAGE_COMPONENT"]; user?: User; acknowledge(): Promise; createFollowup(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise; createMessage(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise; defer(flags?: number): Promise; deferUpdate(): Promise; deleteMessage(messageID: string): Promise; deleteOriginalMessage(): Promise; editMessage(messageID: string, content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise; editOriginalMessage(content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise; editParent(content: InteractionContentEdit, file?: FileContent | FileContent[]): Promise; getOriginalMessage(): Promise } export class AutocompleteInteraction extends Interaction { appPermissions?: Permission; channel: T; data: { id: string; name: string; type: Constants["ApplicationCommandTypes"]["CHAT_INPUT"]; target_id?: string; options: InteractionDataOptions[]; }; guildID?: string; member?: Member; type: Constants["InteractionTypes"]["APPLICATION_COMMAND_AUTOCOMPLETE"]; user?: User; acknowledge(choices: ApplicationCommandOptionChoice[]): Promise; result(choices: ApplicationCommandOptionChoice[]): Promise; } export class UnknownInteraction extends Interaction { appPermissions?: Permission; channel?: T; data?: unknown; guildID?: string; member?: Member; message?: Message; type: number; user?: User; acknowledge(data: InteractionOptions): Promise; createFollowup(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise; createMessage(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise; defer(flags?: number): Promise; deferUpdate(): Promise; deleteMessage(messageID: string): Promise; deleteOriginalMessage(): Promise; editMessage(messageID: string, content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise; editOriginalMessage(content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise; editParent(content: InteractionContentEdit, file?: FileContent | FileContent[]): Promise; getOriginalMessage(): Promise pong(): Promise; result(choices: ApplicationCommandOptionChoice[]): Promise; } // If CT (count) is "withMetadata", it will not have count properties export class Invite extends Base { channel: CH; code: string; // @ts-ignore: Property is only not null when invite metadata is supplied createdAt: CT extends "withMetadata" ? number : null; guild: CT extends "withMetadata" ? Guild // Invite with Metadata always has guild prop : CH extends Extract // Invite without Metadata ? never // If the channel is GroupChannel, there is no guild : CH extends Exclude // Invite without Metadata and not GroupChanel ? Guild // If the invite channel is not partial : Guild | undefined; // If the invite channel is partial inviter?: User; maxAge: CT extends "withMetadata" ? number : null; maxUses: CT extends "withMetadata" ? number : null; memberCount: CT extends "withMetadata" | "withoutCount" ? null : number; presenceCount: CT extends "withMetadata" | "withoutCount" ? null : number; stageInstance: CH extends StageChannel ? InviteStageInstance : null; temporary: CT extends "withMetadata" ? boolean : null; uses: CT extends "withMetadata" ? number : null; constructor(data: BaseData, client: Client); delete(reason?: string): Promise; } export class Member extends Base implements Presence { accentColor?: number | null; activities?: Activity[]; avatar: string | null; avatarURL: string; banner?: string | null; bannerURL: string | null; bot: boolean; clientStatus?: ClientStatus; communicationDisabledUntil: number | null; createdAt: number; defaultAvatar: string; defaultAvatarURL: string; discriminator: string; game: Activity | null; guild: Guild; id: string; joinedAt: number | null; mention: string; nick: string | null; pending?: boolean; /** @deprecated */ permission: Permission; permissions: Permission; premiumSince?: number | null; roles: string[]; staticAvatarURL: string; status?: Status; user: User; username: string; voiceState: VoiceState; constructor(data: BaseData, guild?: Guild, client?: Client); addRole(roleID: string, reason?: string): Promise; ban(deleteMessageDays?: number, reason?: string): Promise; dynamicAvatarURL(format?: ImageFormat, size?: number): string; edit(options: MemberOptions, reason?: string): Promise; kick(reason?: string): Promise; removeRole(roleID: string, reason?: string): Promise; unban(reason?: string): Promise; } export class Message extends Base { activity?: MessageActivity; application?: MessageApplication; applicationID?: string; attachments: Attachment[]; author: User; channel: T; channelMentions: string[]; /** @deprecated */ cleanContent: string; command?: Command; components?: ActionRow[]; content: string; createdAt: number; editedTimestamp?: number; embeds: Embed[]; flags: number; guildID: T extends GuildTextableWithThread ? string : undefined; id: string; interaction: MessageInteraction | null; jumpLink: string; member: T extends GuildTextableWithThread ? Member : null; mentionEveryone: boolean; mentions: User[]; messageReference: MessageReference | null; pinned: boolean; prefix?: string; reactions: { [s: string]: { count: number; me: boolean } }; referencedMessage?: Message | null; roleMentions: string[]; stickerItems?: StickerItems[]; /** @deprecated */ stickers?: Sticker[]; timestamp: number; tts: boolean; type: number; webhookID: T extends GuildTextableWithThread ? string | undefined : undefined; constructor(data: BaseData, client: Client); addReaction(reaction: string): Promise; /** @deprecated */ addReaction(reaction: string, userID: string): Promise; createThreadWithMessage(options: CreateThreadOptions): Promise; crosspost(): Promise : never>; delete(reason?: string): Promise; deleteWebhook(token: string): Promise; edit(content: MessageContent): Promise>; editWebhook(token: string, options: MessageWebhookContent): Promise>; getReaction(reaction: string, options?: GetMessageReactionOptions): Promise; /** @deprecated */ getReaction(reaction: string, limit?: number, before?: string, after?: string): Promise; pin(): Promise; removeReaction(reaction: string, userID?: string): Promise; removeReactionEmoji(reaction: string): Promise; removeReactions(): Promise; unpin(): Promise; } // News channel rate limit is always 0 export class NewsChannel extends TextChannel implements GuildPinnable { rateLimitPerUser: 0; type: Constants["ChannelTypes"]["GUILD_NEWS"]; createInvite(options?: CreateInviteOptions, reason?: string): Promise>; createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise>; createThreadWithMessage(messageID: string, options: CreateThreadOptions): Promise; crosspostMessage(messageID: string): Promise>; editMessage(messageID: string, content: MessageContentEdit): Promise>; follow(webhookChannelID: string): Promise; getInvites(): Promise<(Invite<"withMetadata", this>)[]>; getMessage(messageID: string): Promise>; getMessages(options?: GetMessagesOptions): Promise[]>; /** @deprecated */ getMessages(limit?: number, before?: string, after?: string, around?: string): Promise[]>; getPins(): Promise[]>; } export class NewsThreadChannel extends ThreadChannel { type: Constants["ChannelTypes"]["GUILD_NEWS_THREAD"]; } export class Permission extends Base { allow: bigint; deny: bigint; json: Record; constructor(allow: number | string | bigint, deny?: number | string | bigint); has(permission: keyof Constants["Permissions"] | bigint): boolean; } export class PermissionOverwrite extends Permission { id: string; type: PermissionType; constructor(data: Overwrite); } export class Piper extends EventEmitter { converterCommand: ConverterCommand; dataPacketCount: number; encoding: boolean; libopus: boolean; opus: OpusScript | null; opusFactory: () => OpusScript; volumeLevel: number; constructor(converterCommand: string, opusFactory: OpusScript); addDataPacket(packet: unknown): void; encode(source: string | Stream, options: VoiceResourceOptions): boolean; getDataPacket(): Buffer; reset(): void; resetPackets(): void; setVolume(volume: number): void; stop(e: Error, source: Duplex): void; } export class PrivateChannel extends Channel implements Textable, Pinnable { lastMessageID: string; messages: Collection>; recipient: User; type: PrivateChannelTypes; addMessageReaction(messageID: string, reaction: string): Promise; /** @deprecated */ addMessageReaction(messageID: string, reaction: string, userID: string): Promise; createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise>; deleteMessage(messageID: string, reason?: string): Promise; editMessage(messageID: string, content: MessageContentEdit): Promise>; getMessage(messageID: string): Promise>; getMessageReaction(messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise; /** @deprecated */ getMessageReaction(messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise; getMessages(options?: GetMessagesOptions): Promise[]>; /** @deprecated */ getMessages(limit?: number, before?: string, after?: string, around?: string): Promise[]>; getPins(): Promise[]>; leave(): Promise; pinMessage(messageID: string): Promise; removeMessageReaction(messageID: string, reaction: string): Promise; /** @deprecated */ removeMessageReaction(messageID: string, reaction: string, userID: string): Promise; ring(recipient: string[]): void; sendTyping(): Promise; syncCall(): void; unpinMessage(messageID: string): Promise; unsendMessage(messageID: string): Promise; } export class PrivateThreadChannel extends ThreadChannel { threadMetadata: PrivateThreadMetadata; type: Constants["ChannelTypes"]["GUILD_PRIVATE_THREAD"]; } export class PublicThreadChannel extends ThreadChannel { type: GuildPublicThreadChannelTypes; edit(options: Pick, reason?: string): Promise; } export class Relationship extends Base implements Omit { activities: Activity[] | null; clientStatus?: ClientStatus; id: string; status: Status; type: number; user: User; constructor(data: BaseData, client: Client); } export class RequestHandler implements SimpleJSON { globalBlock: boolean; latencyRef: LatencyRef; options: RequestHandlerOptions; ratelimits: { [route: string]: SequentialBucket }; readyQueue: (() => void)[]; userAgent: string; constructor(client: Client, options?: RequestHandlerOptions); /** @deprecated */ constructor(client: Client, forceQueueing?: boolean); globalUnblock(): void; request(method: RequestMethod, url: string, auth?: boolean, body?: { [s: string]: unknown }, file?: FileContent, _route?: string, short?: boolean): Promise; routefy(url: string, method: RequestMethod): string; toString(): string; toJSON(props?: string[]): JSONCache; } export class Role extends Base { color: number; createdAt: number; guild: Guild; hoist: boolean; icon: string | null; iconURL: string | null; id: string; json: Partial, boolean>>; managed: boolean; mention: string; mentionable: boolean; name: string; permissions: Permission; position: number; tags?: RoleTags; unicodeEmoji: string | null; constructor(data: BaseData, guild: Guild); delete(reason?: string): Promise; edit(options: RoleOptions, reason?: string): Promise; editPosition(position: number): Promise; } class SequentialBucket { latencyRef: LatencyRef; limit: number; processing: boolean; remaining: number; reset: number; constructor(limit: number, latencyRef?: LatencyRef); check(override?: boolean): void; queue(func: (cb: () => void) => void, short?: boolean): void; } export class Shard extends EventEmitter implements SimpleJSON { client: Client; connectAttempts: number; connecting: boolean; connectTimeout: NodeJS.Timeout | null; discordServerTrace?: string[]; getAllUsersCount: { [guildID: string]: boolean }; getAllUsersLength: number; getAllUsersQueue: string; globalBucket: Bucket; guildCreateTimeout: NodeJS.Timeout | null; guildSyncQueue: string[]; guildSyncQueueLength: number; heartbeatInterval: NodeJS.Timeout | null; id: number; lastHeartbeatAck: boolean; lastHeartbeatReceived: number | null; lastHeartbeatSent: number | null; latency: number; preReady: boolean; presence: ClientPresence; presenceUpdateBucket: Bucket; ready: boolean; reconnectInterval: number; requestMembersPromise: { [s: string]: RequestMembersPromise }; resumeURL: string | null; seq: number; sessionID: string | null; status: "connecting" | "disconnected" | "handshaking" | "identifying" | "ready" | "resuming"; unsyncedGuilds: number; ws: WebSocket | BrowserWebSocket | null; constructor(id: number, client: Client); checkReady(): void; connect(): void; createGuild(_guild: Guild): Guild; disconnect(options?: { reconnect?: boolean | "auto" }, error?: Error): void; editAFK(afk: boolean): void; editStatus(status: SelfStatus, activities?: ActivityPartial[] | ActivityPartial): void; editStatus(activities?: ActivityPartial[] | ActivityPartial): void; // @ts-ignore: Method override emit(event: string, ...args: any[]): void; emit(event: K, ...args: ShardEvents[K]): boolean; emit(event: string, ...args: any[]): boolean; getGuildMembers(guildID: string, timeout: number): void; hardReset(): void; heartbeat(normal?: boolean): void; identify(): void; initializeWS(): void; off(event: K, listener: (...args: ShardEvents[K]) => void): this; off(event: string, listener: (...args: any[]) => void): this; once(event: K, listener: (...args: ShardEvents[K]) => void): this; once(event: string, listener: (...args: any[]) => void): this; onPacket(packet: RawPacket): void; requestGuildMembers(guildID: string, options?: RequestGuildMembersOptions): Promise; requestGuildSync(guildID: string): void; reset(): void; restartGuildCreateTimeout(): void; resume(): void; sendStatusUpdate(): void; sendWS(op: number, _data: Record, priority?: boolean): void; syncGuild(guildID: string): void; wsEvent(packet: Required): void; on(event: K, listener: (...args: ShardEvents[K]) => void): this; on(event: string, listener: (...args: any[]) => void): this; toJSON(props?: string[]): JSONCache; } export class ShardManager extends Collection implements SimpleJSON { buckets: Map; connectQueue: Shard[]; connectTimeout: NodeJS.Timer | null; constructor(client: Client, options: ShardManagerOptions); connect(shard: Shard): void; spawn(id: number): void; tryConnect(): void; toString(): string; toJSON(props?: string[]): JSONCache; } export class SharedStream extends EventEmitter { bitrate: number; channels: number; current?: VoiceStreamCurrent; ended: boolean; frameDuration: number; piper: Piper; playing: boolean; samplingRate: number; speaking: boolean; voiceConnections: Collection; volume: number; add(connection: VoiceConnection): void; emit(event: K, ...args: StreamEvents[K]): boolean; emit(event: string, ...args: any[]): boolean; off(event: K, listener: (...args: StreamEvents[K]) => void): this; off(event: string, listener: (...args: any[]) => void): this; once(event: K, listener: (...args: StreamEvents[K]) => void): this; once(event: string, listener: (...args: any[]) => void): this; play(resource: ReadableStream | string, options?: VoiceResourceOptions): void; remove(connection: VoiceConnection): void; setSpeaking(value: boolean): void; setVolume(volume: number): void; stopPlaying(): void; on(event: K, listener: (...args: StreamEvents[K]) => void): this; on(event: string, listener: (...args: any[]) => void): this; } export class StageChannel extends VoiceChannel { topic?: string; type: Constants["ChannelTypes"]["GUILD_STAGE_VOICE"]; createInstance(options: StageInstanceOptions): Promise; deleteInstance(): Promise; editInstance(options: StageInstanceOptions): Promise; getInstance(): Promise; } export class StageInstance extends Base { channel: StageChannel | Uncached; client: Client; discoverableDisabled: boolean; guild: Guild | Uncached; privacyLevel: StageInstancePrivacyLevel; topic: string; constructor(data: BaseData, client: Client); delete(): Promise; edit(options: StageInstanceOptions): Promise; update(data: BaseData): void; } export class StoreChannel extends GuildChannel { type: Constants["ChannelTypes"]["GUILD_STORE"]; edit(options: Omit, reason?: string): Promise; } export class TextChannel extends GuildChannel implements GuildTextable, Invitable, GuildPinnable { defaultAutoArchiveDuration: AutoArchiveDuration; lastMessageID: string; lastPinTimestamp: number | null; messages: Collection>; rateLimitPerUser: number; topic?: string | null; type: GuildTextChannelTypes; constructor(data: BaseData, client: Client, messageLimit: number); addMessageReaction(messageID: string, reaction: string): Promise; /** @deprecated */ addMessageReaction(messageID: string, reaction: string, userID: string): Promise; createInvite(options?: CreateInviteOptions, reason?: string): Promise>; createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise>; createThreadWithMessage(messageID: string, options: CreateThreadOptions): Promise; createThreadWithoutMessage(options: CreateThreadWithoutMessageOptions): Promise; createWebhook(options: { name: string; avatar?: string | null }, reason?: string): Promise; deleteMessage(messageID: string, reason?: string): Promise; deleteMessages(messageIDs: string[], reason?: string): Promise; edit(options: Omit, reason?: string): Promise; editMessage(messageID: string, content: MessageContentEdit): Promise>; /** @deprecated */ getActiveThreads(): Promise; getArchivedThreads(type: "private", options?: GetArchivedThreadsOptions): Promise>; getArchivedThreads(type: "public", options?: GetArchivedThreadsOptions): Promise>; getInvites(): Promise<(Invite<"withMetadata", this>)[]>; getJoinedPrivateArchivedThreads(options: GetArchivedThreadsOptions): Promise>; getMessage(messageID: string): Promise>; getMessageReaction(messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise; /** @deprecated */ getMessageReaction(messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise; getMessages(options?: GetMessagesOptions): Promise[]>; /** @deprecated */ getMessages(limit?: number, before?: string, after?: string, around?: string): Promise[]>; getPins(): Promise[]>; getWebhooks(): Promise; pinMessage(messageID: string): Promise; purge(options: PurgeChannelOptions): Promise; /** @deprecated */ purge(limit: number, filter?: (message: Message) => boolean, before?: string, after?: string, reason?: string): Promise; removeMessageReaction(messageID: string, reaction: string, userID?: string): Promise; removeMessageReactionEmoji(messageID: string, reaction: string): Promise; removeMessageReactions(messageID: string): Promise; sendTyping(): Promise; unpinMessage(messageID: string): Promise; unsendMessage(messageID: string): Promise; } export class ThreadChannel extends GuildChannel implements ThreadTextable { lastMessageID: string; lastPinTimestamp?: number; member?: ThreadMember; memberCount: number; members: Collection; messageCount: number; messages: Collection>; ownerID: string; rateLimitPerUser: number; threadMetadata: ThreadMetadata; type: GuildThreadChannelTypes; constructor(data: BaseData, client: Client, messageLimit?: number); addMessageReaction(messageID: string, reaction: string): Promise; createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise>; deleteMessage(messageID: string, reason?: string): Promise; deleteMessages(messageIDs: string[], reason?: string): Promise; edit(options: Pick, reason?: string): Promise; editMessage(messageID: string, content: MessageContentEdit): Promise>; getMembers(): Promise; getMessage(messageID: string): Promise>; getMessageReaction(messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise; /** @deprecated */ getMessageReaction(messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise; getMessages(options?: GetMessagesOptions): Promise[]>; /** @deprecated */ getMessages(limit?: number, before?: string, after?: string, around?: string): Promise[]>; getPins(): Promise[]>; join(userID?: string): Promise; leave(userID?: string): Promise; pinMessage(messageID: string): Promise; purge(options: PurgeChannelOptions): Promise; removeMessageReaction(messageID: string, reaction: string, userID?: string): Promise; removeMessageReactionEmoji(messageID: string, reaction: string): Promise; removeMessageReactions(messageID: string): Promise; sendTyping(): Promise; unpinMessage(messageID: string): Promise; unsendMessage(messageID: string): Promise; } export class ThreadMember extends Base { flags: number; guildMember?: Member; joinTimestamp: number; threadID: string; constructor(data: BaseData, client: Client); leave(): Promise; update(data: BaseData): void; } export class UnavailableGuild extends Base { createdAt: number; id: string; shard: Shard; unavailable: boolean; constructor(data: BaseData, client: Client); } export class User extends Base { accentColor?: number | null; avatar: string | null; avatarURL: string; banner?: string | null; bannerURL: string | null; bot: boolean; createdAt: number; defaultAvatar: string; defaultAvatarURL: string; discriminator: string; id: string; mention: string; publicFlags?: number; staticAvatarURL: string; system: boolean; username: string; constructor(data: BaseData, client: Client); addRelationship(block?: boolean): Promise; deleteNote(): Promise; dynamicAvatarURL(format?: ImageFormat, size?: number): string; dynamicBannerURL(format?: ImageFormat, size?: number): string | null; editNote(note: string): Promise; getDMChannel(): Promise; getProfile(): Promise; removeRelationship(): Promise; } export class VoiceChannel extends GuildChannel implements Invitable { bitrate: number; rtcRegion: string | null; type: TextVoiceChannelTypes; userLimit: number; videoQualityMode: VideoQualityMode; voiceMembers: Collection; createInvite(options?: CreateInviteOptions, reason?: string): Promise>; getInvites(): Promise<(Invite<"withMetadata", VoiceChannel>)[]>; join(options?: JoinVoiceChannelOptions): Promise; leave(): void; } export class VoiceConnection extends EventEmitter implements SimpleJSON { bitrate: number; channelID: string | null; channels: number; connecting: boolean; connectionTimeout: NodeJS.Timeout | null; current?: VoiceStreamCurrent | null; ended?: boolean; endpoint: URL; frameDuration: number; frameSize: number; heartbeatInterval: NodeJS.Timeout | null; id: string; mode?: string; modes?: string; /** Optional dependencies OpusScript (opusscript) or OpusEncoder (@discordjs/opus) */ opus: { [userID: string]: unknown }; opusOnly: boolean; paused: boolean; pcmSize: number; piper: Piper; playing: boolean; ready: boolean; receiveStreamOpus?: VoiceDataStream | null; receiveStreamPCM?: VoiceDataStream | null; reconnecting: boolean; samplingRate: number; secret: Buffer; sendBuffer: Buffer; sendNonce: Buffer; sequence: number; shard: Shard | Record; shared: boolean; speaking: boolean; ssrc?: number; ssrcUserMap: { [s: number]: string }; timestamp: number; udpIP?: string; udpPort?: number; udpSocket: DgramSocket | null; volume: number; ws: BrowserWebSocket | WebSocket | null; constructor(id: string, options?: { shard?: Shard; shared?: boolean; opusOnly?: boolean }); connect(data: VoiceConnectData): NodeJS.Timer | void; disconnect(error?: Error, reconnecting?: boolean): void; emit(event: K, ...args: VoiceEvents[K]): boolean; emit(event: string, ...args: any[]): boolean; heartbeat(): void; off(event: K, listener: (...args: VoiceEvents[K]) => void): this; off(event: string, listener: (...args: any[]) => void): this; once(event: K, listener: (...args: VoiceEvents[K]) => void): this; once(event: string, listener: (...args: any[]) => void): this; pause(): void; play(resource: ReadableStream | string, options?: VoiceResourceOptions): void; receive(type: "opus" | "pcm"): VoiceDataStream; registerReceiveEventHandler(): void; resume(): void; sendAudioFrame(frame: Buffer): void; sendUDPPacket(packet: Buffer): void; sendWS(op: number, data: Record): void; setSpeaking(value: boolean): void; setVolume(volume: number): void; stopPlaying(): void; switchChannel(channelID: string): void; updateVoiceState(selfMute: boolean, selfDeaf: boolean): void; on(event: K, listener: (...args: VoiceEvents[K]) => void): this; on(event: string, listener: (...args: any[]) => void): this; toJSON(props?: string[]): JSONCache; } export class VoiceConnectionManager extends Collection implements SimpleJSON { constructor(vcObject: new () => T); join(guildID: string, channelID: string, options: VoiceResourceOptions): Promise; leave(guildID: string): void; switch(guildID: string, channelID: string): void; voiceServerUpdate(data: VoiceServerUpdateData): void; toJSON(props?: string[]): JSONCache; } export class VoiceDataStream extends EventEmitter { type: "opus" | "pcm"; constructor(type: string); on(event: "data", listener: (data: Buffer, userID: string, timestamp: number, sequence: number) => void): this; } export class VoiceState extends Base { channelID: string | null; createdAt: number; deaf: boolean; id: string; mute: boolean; requestToSpeakTimestamp: number | null; selfDeaf: boolean; selfMute: boolean; selfStream: boolean; selfVideo: boolean; sessionID: string | null; suppress: boolean; constructor(data: BaseData); } } export = Eris;