// DOM types required for undici /// import { ActionRowBuilder as BuilderActionRow, MessageActionRowComponentBuilder, blockQuote, bold, ButtonBuilder as BuilderButtonComponent, channelMention, codeBlock, EmbedBuilder as BuildersEmbed, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, italic, quote, roleMention, ChannelSelectMenuBuilder as BuilderChannelSelectMenuComponent, MentionableSelectMenuBuilder as BuilderMentionableSelectMenuComponent, RoleSelectMenuBuilder as BuilderRoleSelectMenuComponent, StringSelectMenuBuilder as BuilderStringSelectMenuComponent, UserSelectMenuBuilder as BuilderUserSelectMenuComponent, TextInputBuilder as BuilderTextInputComponent, SelectMenuOptionBuilder as BuildersSelectMenuOption, spoiler, strikethrough, time, TimestampStyles, underscore, userMention, ModalActionRowComponentBuilder, ModalBuilder as BuildersModal, AnyComponentBuilder, ComponentBuilder, type RestOrArray, ApplicationCommandOptionAllowedChannelTypes, } from '@discordjs/builders'; import { Awaitable, JSONEncodable } from '@discordjs/util'; import { Collection } from '@discordjs/collection'; import { BaseImageURLOptions, ImageURLOptions, RawFile, REST, RESTOptions } from '@discordjs/rest'; import { WebSocketManager as WSWebSocketManager, IShardingStrategy, IIdentifyThrottler, SessionInfo, } from '@discordjs/ws'; import { APIActionRowComponent, APIApplicationCommandInteractionData, APIApplicationCommandOption, APIAuditLogChange, APIButtonComponent, APIEmbed, APIEmoji, APIInteractionDataResolvedChannel, APIInteractionDataResolvedGuildMember, APIInteractionGuildMember, APIMessage, APIMessageComponent, APIOverwrite, APIPartialChannel, APIPartialEmoji, APIPartialGuild, APIRole, APISelectMenuComponent, APITemplateSerializedSourceGuild, APIUser, ButtonStyle, ChannelType, ComponentType, GatewayDispatchEvents, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, GuildFeature, GuildMFALevel, GuildNSFWLevel, GuildPremiumTier, GuildVerificationLevel, Locale, InteractionType, InviteTargetType, MessageType, OAuth2Scopes, RESTPostAPIApplicationCommandsJSONBody, Snowflake, StageInstancePrivacyLevel, StickerFormatType, StickerType, TeamMemberMembershipState, WebhookType, OverwriteType, GuildExplicitContentFilter, GuildDefaultMessageNotifications, ApplicationCommandPermissionType, ApplicationCommandOptionType, ApplicationCommandType, ActivityType, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventStatus, IntegrationExpireBehavior, ApplicationFlags, PermissionFlagsBits, ThreadMemberFlags, UserFlags, MessageFlags, GuildSystemChannelFlags, GatewayIntentBits, ActivityFlags, AuditLogEvent, APIMessageComponentEmoji, EmbedType, APIActionRowComponentTypes, APIModalInteractionResponseCallbackData, APIModalSubmitInteraction, APIMessageActionRowComponent, TextInputStyle, APITextInputComponent, APIModalActionRowComponent, APIModalComponent, APISelectMenuOption, APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, VideoQualityMode, LocalizationMap, LocaleString, MessageActivityType, APIAttachment, APIChannel, ThreadAutoArchiveDuration, FormattingPatterns, APIEmbedProvider, AuditLogOptionsType, TextChannelType, ChannelFlags, SortOrderType, APIMessageStringSelectInteractionData, APIMessageUserSelectInteractionData, APIStringSelectComponent, APIUserSelectComponent, APIRoleSelectComponent, APIMentionableSelectComponent, APIChannelSelectComponent, APIGuildMember, APIMessageRoleSelectInteractionData, APIMessageMentionableSelectInteractionData, APIMessageChannelSelectInteractionData, AutoModerationRuleKeywordPresetType, AutoModerationActionType, AutoModerationRuleEventType, AutoModerationRuleTriggerType, AuditLogRuleTriggerType, GatewayAutoModerationActionExecutionDispatchData, APIAutoModerationRule, ForumLayoutType, ApplicationRoleConnectionMetadataType, APIApplicationRoleConnectionMetadata, ImageFormat, GuildMemberFlags, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildOnboardingResult, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, GuildOnboardingPromptType, AttachmentFlags, RoleFlags, } from 'discord-api-types/v10'; import { ChildProcess } from 'node:child_process'; import { EventEmitter } from 'node:events'; import { Stream } from 'node:stream'; import { MessagePort, Worker } from 'node:worker_threads'; import * as WebSocket from 'ws'; import { RawActivityData, RawAnonymousGuildData, RawApplicationCommandData, RawApplicationData, RawBaseGuildData, RawChannelData, RawClientApplicationData, RawDMChannelData, RawEmojiData, RawGuildAuditLogData, RawGuildAuditLogEntryData, RawGuildBanData, RawGuildChannelData, RawGuildData, RawGuildEmojiData, RawGuildMemberData, RawGuildPreviewData, RawGuildScheduledEventData, RawGuildTemplateData, RawIntegrationApplicationData, RawIntegrationData, RawInteractionData, RawInviteData, RawInviteGuildData, RawInviteStageInstance, RawMessageButtonInteractionData, RawMessageComponentInteractionData, RawMessageData, RawMessagePayloadData, RawMessageReactionData, RawOAuth2GuildData, RawPartialGroupDMChannelData, RawPartialMessageData, RawPermissionOverwriteData, RawPresenceData, RawReactionEmojiData, RawRichPresenceAssets, RawRoleData, RawStageInstanceData, RawStickerData, RawStickerPackData, RawTeamData, RawTeamMemberData, RawThreadChannelData, RawThreadMemberData, RawTypingData, RawUserData, RawVoiceRegionData, RawVoiceStateData, RawWebhookData, RawWelcomeChannelData, RawWelcomeScreenData, RawWidgetData, RawWidgetMemberData, } from './rawDataTypes'; declare module 'node:events' { class EventEmitter { // Add type overloads for client events. public static once( eventEmitter: E, eventName: E extends Client ? K : string, ): Promise; public static on( eventEmitter: E, eventName: E extends Client ? K : string, ): AsyncIterableIterator; } } //#region Classes export class Activity { private constructor(presence: Presence, data?: RawActivityData); public readonly presence: Presence; public applicationId: Snowflake | null; public assets: RichPresenceAssets | null; public buttons: string[]; public get createdAt(): Date; public createdTimestamp: number; public details: string | null; public emoji: Emoji | null; public flags: Readonly; public name: string; public party: { id: string | null; size: [number, number]; } | null; public state: string | null; public timestamps: { start: Date | null; end: Date | null; } | null; public type: ActivityType; public url: string | null; public equals(activity: Activity): boolean; public toString(): string; } export type ActivityFlagsString = keyof typeof ActivityFlags; export interface BaseComponentData { type: ComponentType; } export type MessageActionRowComponentData = | JSONEncodable | ButtonComponentData | StringSelectMenuComponentData | UserSelectMenuComponentData | RoleSelectMenuComponentData | MentionableSelectMenuComponentData | ChannelSelectMenuComponentData; export type ModalActionRowComponentData = JSONEncodable | TextInputComponentData; export type ActionRowComponentData = MessageActionRowComponentData | ModalActionRowComponentData; export type ActionRowComponent = MessageActionRowComponent | ModalActionRowComponent; export interface ActionRowData | ActionRowComponentData> extends BaseComponentData { components: T[]; } export class ActionRowBuilder extends BuilderActionRow { constructor( data?: Partial< | ActionRowData> | APIActionRowComponent >, ); public static from( other: | JSONEncodable>> | APIActionRowComponent>, ): ActionRowBuilder; } export type MessageActionRowComponent = | ButtonComponent | StringSelectMenuComponent | UserSelectMenuComponent | RoleSelectMenuComponent | MentionableSelectMenuComponent | ChannelSelectMenuComponent; export type ModalActionRowComponent = TextInputComponent; export class ActionRow extends Component< APIActionRowComponent > { private constructor(data: APIActionRowComponent); public readonly components: T[]; public toJSON(): APIActionRowComponent>; } export class ActivityFlagsBitField extends BitField { public static Flags: typeof ActivityFlags; public static resolve(bit?: BitFieldResolvable): number; } export abstract class AnonymousGuild extends BaseGuild { protected constructor(client: Client, data: RawAnonymousGuildData, immediatePatch?: boolean); public banner: string | null; public description: string | null; public nsfwLevel: GuildNSFWLevel; public premiumSubscriptionCount: number | null; public splash: string | null; public vanityURLCode: string | null; public verificationLevel: GuildVerificationLevel; public bannerURL(options?: ImageURLOptions): string | null; public splashURL(options?: ImageURLOptions): string | null; } export class AutoModerationActionExecution { private constructor(data: GatewayAutoModerationActionExecutionDispatchData, guild: Guild); public guild: Guild; public action: AutoModerationAction; public ruleId: Snowflake; public ruleTriggerType: AutoModerationRuleTriggerType; public get user(): User | null; public userId: Snowflake; public get channel(): GuildTextBasedChannel | ForumChannel | null; public channelId: Snowflake | null; public get member(): GuildMember | null; public messageId: Snowflake | null; public alertSystemMessageId: Snowflake | null; public content: string; public matchedKeyword: string | null; public matchedContent: string | null; public get autoModerationRule(): AutoModerationRule | null; } export class AutoModerationRule extends Base { private constructor(client: Client, data: APIAutoModerationRule, guild: Guild); public id: Snowflake; public guild: Guild; public name: string; public creatorId: Snowflake; public eventType: AutoModerationRuleEventType; public triggerType: AutoModerationRuleTriggerType; public triggerMetadata: AutoModerationTriggerMetadata; public actions: AutoModerationAction[]; public enabled: boolean; public exemptRoles: Collection; public exemptChannels: Collection; public edit(options: AutoModerationRuleEditOptions): Promise; public delete(reason?: string): Promise; public setName(name: string, reason?: string): Promise; public setEventType(eventType: AutoModerationRuleEventType, reason?: string): Promise; public setKeywordFilter(keywordFilter: string[], reason?: string): Promise; public setRegexPatterns(regexPatterns: string[], reason?: string): Promise; public setPresets(presets: AutoModerationRuleKeywordPresetType[], reason?: string): Promise; public setAllowList(allowList: string[], reason?: string): Promise; public setMentionTotalLimit(mentionTotalLimit: number, reason?: string): Promise; public setMentionRaidProtectionEnabled( mentionRaidProtectionEnabled: boolean, reason?: string, ): Promise; public setActions(actions: AutoModerationActionOptions[], reason?: string): Promise; public setEnabled(enabled?: boolean, reason?: string): Promise; public setExemptRoles( roles: Collection | RoleResolvable[], reason?: string, ): Promise; public setExemptChannels( channels: Collection | GuildChannelResolvable[], reason?: string, ): Promise; } export abstract class Application extends Base { protected constructor(client: Client, data: RawApplicationData); public get createdAt(): Date; public get createdTimestamp(): number; public description: string | null; public icon: string | null; public id: Snowflake; public name: string | null; public coverURL(options?: ImageURLOptions): string | null; public iconURL(options?: ImageURLOptions): string | null; public toJSON(): unknown; public toString(): string | null; } export class ApplicationCommand extends Base { private constructor(client: Client, data: RawApplicationCommandData, guild?: Guild, guildId?: Snowflake); public applicationId: Snowflake; public get createdAt(): Date; public get createdTimestamp(): number; public defaultMemberPermissions: Readonly | null; public description: string; public descriptionLocalizations: LocalizationMap | null; public descriptionLocalized: string | null; public dmPermission: boolean | null; public guild: Guild | null; public guildId: Snowflake | null; public get manager(): ApplicationCommandManager; public id: Snowflake; public name: string; public nameLocalizations: LocalizationMap | null; public nameLocalized: string | null; public options: (ApplicationCommandOption & { nameLocalized?: string; descriptionLocalized?: string })[]; public permissions: ApplicationCommandPermissionsManager< PermissionsFetchType, PermissionsFetchType, Guild | null, Snowflake >; public type: ApplicationCommandType; public version: Snowflake; public nsfw: boolean; public delete(): Promise>; public edit(data: Partial): Promise>; public setName(name: string): Promise>; public setNameLocalizations(nameLocalizations: LocalizationMap): Promise>; public setDescription(description: string): Promise>; public setDescriptionLocalizations( descriptionLocalizations: LocalizationMap, ): Promise>; public setDefaultMemberPermissions( defaultMemberPermissions: PermissionResolvable | null, ): Promise>; public setDMPermission(dmPermission?: boolean): Promise>; public setOptions(options: ApplicationCommandOptionData[]): Promise>; public equals( command: ApplicationCommand | ApplicationCommandData | RawApplicationCommandData, enforceOptionOrder?: boolean, ): boolean; public static optionsEqual( existing: ApplicationCommandOption[], options: ApplicationCommandOption[] | ApplicationCommandOptionData[] | APIApplicationCommandOption[], enforceOptionOrder?: boolean, ): boolean; private static _optionEquals( existing: ApplicationCommandOption, options: ApplicationCommandOption | ApplicationCommandOptionData | APIApplicationCommandOption, enforceOptionOrder?: boolean, ): boolean; private static transformOption(option: ApplicationCommandOptionData, received?: boolean): unknown; private static transformCommand(command: ApplicationCommandData): RESTPostAPIApplicationCommandsJSONBody; private static isAPICommandData(command: object): command is RESTPostAPIApplicationCommandsJSONBody; } export class ApplicationRoleConnectionMetadata { private constructor(data: APIApplicationRoleConnectionMetadata); public name: string; public nameLocalizations: LocalizationMap | null; public description: string; public descriptionLocalizations: LocalizationMap | null; public key: string; public type: ApplicationRoleConnectionMetadataType; } export type ApplicationResolvable = Application | Activity | Snowflake; export class ApplicationFlagsBitField extends BitField { public static Flags: typeof ApplicationFlags; public static resolve(bit?: BitFieldResolvable): number; } export type AutoModerationRuleResolvable = AutoModerationRule | Snowflake; export abstract class Base { public constructor(client: Client); public readonly client: Client; public toJSON(...props: Record[]): unknown; public valueOf(): string; } export class BaseClient extends EventEmitter { public constructor(options?: ClientOptions | WebhookClientOptions); private decrementMaxListeners(): void; private incrementMaxListeners(): void; public options: ClientOptions | WebhookClientOptions; public rest: REST; public destroy(): void; public toJSON(...props: Record[]): unknown; } export type GuildCacheMessage = CacheTypeReducer< Cached, Message, APIMessage, Message | APIMessage, Message | APIMessage >; export type BooleanCache = T extends 'cached' ? true : false; export abstract class CommandInteraction extends BaseInteraction { public type: InteractionType.ApplicationCommand; public get command(): ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null; public options: Omit< CommandInteractionOptionResolver, | 'getMessage' | 'getFocused' | 'getMentionable' | 'getRole' | 'getAttachment' | 'getNumber' | 'getInteger' | 'getString' | 'getChannel' | 'getBoolean' | 'getSubcommandGroup' | 'getSubcommand' >; public channelId: Snowflake; public commandId: Snowflake; public commandName: string; public commandType: ApplicationCommandType; public commandGuildId: Snowflake | null; public deferred: boolean; public ephemeral: boolean | null; public replied: boolean; public webhook: InteractionWebhook; public inGuild(): this is CommandInteraction<'raw' | 'cached'>; public inCachedGuild(): this is CommandInteraction<'cached'>; public inRawGuild(): this is CommandInteraction<'raw'>; public deferReply( options: InteractionDeferReplyOptions & { fetchReply: true }, ): Promise>>; public deferReply(options?: InteractionDeferReplyOptions): Promise>>; public deleteReply(message?: MessageResolvable | '@original'): Promise; public editReply( options: string | MessagePayload | InteractionEditReplyOptions, ): Promise>>; public fetchReply(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise>>; public reply( options: string | MessagePayload | InteractionReplyOptions, ): Promise>>; public showModal( modal: | JSONEncodable | ModalComponentData | APIModalInteractionResponseCallbackData, ): Promise; public awaitModalSubmit( options: AwaitModalSubmitOptions, ): Promise>; private transformOption( option: APIApplicationCommandOption, resolved: APIApplicationCommandInteractionData['resolved'], ): CommandInteractionOption; private transformResolved( resolved: APIApplicationCommandInteractionData['resolved'], ): CommandInteractionResolvedData; } export class InteractionResponse { private constructor(interaction: Interaction, id?: Snowflake); public interaction: Interaction>; public client: Client; public id: Snowflake; public get createdAt(): Date; public get createdTimestamp(): number; public awaitMessageComponent( options?: AwaitMessageCollectorOptionsParams, ): Promise[T]>; public createMessageComponentCollector( options?: MessageCollectorOptionsParams, ): InteractionCollector[T]>; public delete(): Promise; public edit(options: string | MessagePayload | WebhookMessageEditOptions): Promise; public fetch(): Promise; } export abstract class BaseGuild extends Base { protected constructor(client: Client, data: RawBaseGuildData); public get createdAt(): Date; public get createdTimestamp(): number; public features: `${GuildFeature}`[]; public icon: string | null; public id: Snowflake; public name: string; public get nameAcronym(): string; public get partnered(): boolean; public get verified(): boolean; public fetch(): Promise; public iconURL(options?: ImageURLOptions): string | null; public toString(): string; } export class BaseGuildEmoji extends Emoji { protected constructor(client: Client, data: RawGuildEmojiData, guild: Guild | GuildPreview); public available: boolean | null; public get createdAt(): Date; public get createdTimestamp(): number; public guild: Guild | GuildPreview; public id: Snowflake; public managed: boolean | null; public requiresColons: boolean | null; } export class BaseGuildTextChannel extends TextBasedChannelMixin(GuildChannel, true) { protected constructor(guild: Guild, data?: RawGuildChannelData, client?: Client, immediatePatch?: boolean); public defaultAutoArchiveDuration?: ThreadAutoArchiveDuration; public rateLimitPerUser: number | null; public nsfw: boolean; public threads: GuildTextThreadManager; public topic: string | null; public createInvite(options?: InviteCreateOptions): Promise; public fetchInvites(cache?: boolean): Promise>; public setDefaultAutoArchiveDuration( defaultAutoArchiveDuration: ThreadAutoArchiveDuration, reason?: string, ): Promise; public setTopic(topic: string | null, reason?: string): Promise; public setType(type: ChannelType.GuildText, reason?: string): Promise; public setType(type: ChannelType.GuildAnnouncement, reason?: string): Promise; } export class BaseGuildVoiceChannel extends TextBasedChannelMixin(GuildChannel, true, [ 'lastPinTimestamp', 'lastPinAt', ]) { public constructor(guild: Guild, data?: RawGuildChannelData); public bitrate: number; public get full(): boolean; public get joinable(): boolean; public get members(): Collection; public nsfw: boolean; public rateLimitPerUser: number | null; public rtcRegion: string | null; public userLimit: number; public videoQualityMode: VideoQualityMode | null; public createInvite(options?: InviteCreateOptions): Promise; public fetchInvites(cache?: boolean): Promise>; public setBitrate(bitrate: number, reason?: string): Promise; public setRTCRegion(rtcRegion: string | null, reason?: string): Promise; public setUserLimit(userLimit: number, reason?: string): Promise; public setVideoQualityMode(videoQualityMode: VideoQualityMode, reason?: string): Promise; } export type EnumLike = Record; export class BitField { public constructor(bits?: BitFieldResolvable); public bitfield: N; public add(...bits: BitFieldResolvable[]): BitField; public any(bit: BitFieldResolvable): boolean; public equals(bit: BitFieldResolvable): boolean; public freeze(): Readonly>; public has(bit: BitFieldResolvable): boolean; public missing(bits: BitFieldResolvable, ...hasParams: readonly unknown[]): S[]; public remove(...bits: BitFieldResolvable[]): BitField; public serialize(...hasParams: readonly unknown[]): Record; public toArray(...hasParams: readonly unknown[]): S[]; public toJSON(): N extends number ? number : string; public valueOf(): N; public [Symbol.iterator](): IterableIterator; public static Flags: EnumLike; public static resolve(bit?: BitFieldResolvable): number | bigint; } export class ButtonInteraction extends MessageComponentInteraction { private constructor(client: Client, data: RawMessageButtonInteractionData); public componentType: ComponentType.Button; public get component(): CacheTypeReducer< Cached, ButtonComponent, APIButtonComponent, ButtonComponent | APIButtonComponent, ButtonComponent | APIButtonComponent >; public inGuild(): this is ButtonInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ButtonInteraction<'cached'>; public inRawGuild(): this is ButtonInteraction<'raw'>; } export type AnyComponent = | APIMessageComponent | APIModalComponent | APIActionRowComponent; export class Component { public readonly data: Readonly; public get type(): T['type']; public toJSON(): T; public equals(other: this | T): boolean; } export class ButtonComponent extends Component { private constructor(data: APIButtonComponent); public get style(): ButtonStyle; public get label(): string | null; public get emoji(): APIMessageComponentEmoji | null; public get disabled(): boolean; public get customId(): string | null; public get url(): string | null; } export type ComponentEmojiResolvable = APIMessageComponentEmoji | string; export class ButtonBuilder extends BuilderButtonComponent { public constructor(data?: Partial | Partial); public static from(other: JSONEncodable | APIButtonComponent): ButtonBuilder; public override setEmoji(emoji: ComponentEmojiResolvable): this; } export class StringSelectMenuBuilder extends BuilderStringSelectMenuComponent { public constructor(data?: Partial); private static normalizeEmoji( selectMenuOption: JSONEncodable | SelectMenuComponentOptionData, ): (APISelectMenuOption | StringSelectMenuOptionBuilder)[]; public override addOptions( ...options: RestOrArray ): this; public override setOptions( ...options: RestOrArray ): this; public static from(other: JSONEncodable | APISelectMenuComponent): StringSelectMenuBuilder; } export { /** @deprecated Use {@link StringSelectMenuBuilder} instead */ StringSelectMenuBuilder as SelectMenuBuilder, /** @deprecated Use {@link StringSelectMenuOptionBuilder} instead */ StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, }; export class UserSelectMenuBuilder extends BuilderUserSelectMenuComponent { public constructor(data?: Partial); public static from(other: JSONEncodable | APISelectMenuComponent): UserSelectMenuBuilder; } export class RoleSelectMenuBuilder extends BuilderRoleSelectMenuComponent { public constructor(data?: Partial); public static from(other: JSONEncodable | APISelectMenuComponent): RoleSelectMenuBuilder; } export class MentionableSelectMenuBuilder extends BuilderMentionableSelectMenuComponent { public constructor(data?: Partial); public static from( other: JSONEncodable | APISelectMenuComponent, ): MentionableSelectMenuBuilder; } export class ChannelSelectMenuBuilder extends BuilderChannelSelectMenuComponent { public constructor(data?: Partial); public static from(other: JSONEncodable | APISelectMenuComponent): ChannelSelectMenuBuilder; } export class StringSelectMenuOptionBuilder extends BuildersSelectMenuOption { public constructor(data?: SelectMenuComponentOptionData | APISelectMenuOption); public override setEmoji(emoji: ComponentEmojiResolvable): this; public static from(other: JSONEncodable | APISelectMenuOption): StringSelectMenuOptionBuilder; } export class ModalBuilder extends BuildersModal { public constructor(data?: Partial | Partial); public static from(other: JSONEncodable | APIModalComponent): ModalBuilder; } export class TextInputBuilder extends BuilderTextInputComponent { public constructor(data?: Partial); public static from(other: JSONEncodable | APITextInputComponent): TextInputBuilder; } export class TextInputComponent extends Component { public get customId(): string; public get value(): string; } export class BaseSelectMenuComponent extends Component { protected constructor(data: Data); public get placeholder(): string | null; public get maxValues(): number | null; public get minValues(): number | null; public get customId(): string; public get disabled(): boolean; } export class StringSelectMenuComponent extends BaseSelectMenuComponent { public get options(): APISelectMenuOption[]; } export { /** @deprecated Use {@link StringSelectMenuComponent} instead */ StringSelectMenuComponent as SelectMenuComponent, }; export class UserSelectMenuComponent extends BaseSelectMenuComponent {} export class RoleSelectMenuComponent extends BaseSelectMenuComponent {} export class MentionableSelectMenuComponent extends BaseSelectMenuComponent {} export class ChannelSelectMenuComponent extends BaseSelectMenuComponent { public getChannelTypes(): ChannelType[] | null; } export interface EmbedData { title?: string; type?: EmbedType; description?: string; url?: string; timestamp?: string | number | Date; color?: number; footer?: EmbedFooterData; image?: EmbedAssetData; thumbnail?: EmbedAssetData; provider?: APIEmbedProvider; author?: EmbedAuthorData; fields?: APIEmbedField[]; video?: EmbedAssetData; } export interface IconData { iconURL?: string; proxyIconURL?: string; } export type EmbedAuthorData = Omit & IconData; export type EmbedFooterData = Omit & IconData; export interface EmbedAssetData extends Omit { proxyURL?: string; } export class EmbedBuilder extends BuildersEmbed { public constructor(data?: EmbedData | APIEmbed); public override setColor(color: ColorResolvable | null): this; public static from(other: JSONEncodable | APIEmbed): EmbedBuilder; public get length(): number; } export class Embed { private constructor(data: APIEmbed); public readonly data: Readonly; public get fields(): APIEmbedField[]; public get footer(): EmbedFooterData | null; public get title(): string | null; public get description(): string | null; public get url(): string | null; public get color(): number | null; public get hexColor(): string | null; public get timestamp(): string | null; public get thumbnail(): EmbedAssetData | null; public get image(): EmbedAssetData | null; public get author(): EmbedAuthorData | null; public get provider(): APIEmbedProvider | null; public get video(): EmbedAssetData | null; public get length(): number; public equals(other: Embed | APIEmbed): boolean; public toJSON(): APIEmbed; } export interface MappedChannelCategoryTypes { [ChannelType.GuildAnnouncement]: NewsChannel; [ChannelType.GuildVoice]: VoiceChannel; [ChannelType.GuildText]: TextChannel; [ChannelType.GuildStageVoice]: StageChannel; [ChannelType.GuildForum]: ForumChannel; } export type CategoryChannelType = Exclude< ChannelType, | ChannelType.DM | ChannelType.GroupDM | ChannelType.PublicThread | ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.GuildCategory | ChannelType.GuildDirectory >; export class CategoryChannel extends GuildChannel { public get children(): CategoryChannelChildManager; public type: ChannelType.GuildCategory; public get parent(): null; public parentId: null; } export type CategoryChannelResolvable = Snowflake | CategoryChannel; export type ChannelFlagsString = keyof typeof ChannelFlags; export type ChannelFlagsResolvable = BitFieldResolvable; export class ChannelFlagsBitField extends BitField { public static Flags: typeof ChannelFlags; public static resolve(bit?: BitFieldResolvable): number; } export abstract class BaseChannel extends Base { public constructor(client: Client, data?: RawChannelData, immediatePatch?: boolean); public get createdAt(): Date | null; public get createdTimestamp(): number | null; public id: Snowflake; public flags: Readonly | null; public get partial(): false; public type: ChannelType; public get url(): string; public delete(): Promise; public fetch(force?: boolean): Promise; public isThread(): this is AnyThreadChannel; public isTextBased(): this is TextBasedChannel; public isDMBased(): this is PartialGroupDMChannel | DMChannel | PartialDMChannel; public isVoiceBased(): this is VoiceBasedChannel; public toString(): ChannelMention | UserMention; } export type If = T extends true ? A : T extends false ? B : A | B; export class Client extends BaseClient { public constructor(options: ClientOptions); private actions: unknown; private presence: ClientPresence; private _eval(script: string): unknown; private _validateOptions(options: ClientOptions): void; private get _censoredToken(): string | null; public application: If; public channels: ChannelManager; public get emojis(): BaseGuildEmojiManager; public guilds: GuildManager; public options: Omit & { intents: IntentsBitField }; public get readyAt(): If; public readyTimestamp: If; public sweepers: Sweepers; public shard: ShardClientUtil | null; public token: If; public get uptime(): If; public user: If; public users: UserManager; public voice: ClientVoiceManager; public ws: WebSocketManager; public destroy(): Promise; public deleteWebhook(id: Snowflake, options?: WebhookDeleteOptions): Promise; public fetchGuildPreview(guild: GuildResolvable): Promise; public fetchInvite(invite: InviteResolvable, options?: ClientFetchInviteOptions): Promise; public fetchGuildTemplate(template: GuildTemplateResolvable): Promise; public fetchVoiceRegions(): Promise>; public fetchSticker(id: Snowflake): Promise; public fetchPremiumStickerPacks(): Promise>; public fetchWebhook(id: Snowflake, token?: string): Promise; public fetchGuildWidget(guild: GuildResolvable): Promise; public generateInvite(options?: InviteGenerationOptions): string; public login(token?: string): Promise; public isReady(): this is Client; public toJSON(): unknown; public on(event: K, listener: (...args: ClientEvents[K]) => Awaitable): this; public on( event: Exclude, listener: (...args: any[]) => Awaitable, ): this; public once(event: K, listener: (...args: ClientEvents[K]) => Awaitable): this; public once( event: Exclude, listener: (...args: any[]) => Awaitable, ): this; public emit(event: K, ...args: ClientEvents[K]): boolean; public emit(event: Exclude, ...args: unknown[]): boolean; public off(event: K, listener: (...args: ClientEvents[K]) => Awaitable): this; public off( event: Exclude, listener: (...args: any[]) => Awaitable, ): this; public removeAllListeners(event?: K): this; public removeAllListeners(event?: Exclude): this; } export class ClientApplication extends Application { private constructor(client: Client, data: RawClientApplicationData); public botPublic: boolean | null; public botRequireCodeGrant: boolean | null; public commands: ApplicationCommandManager; public guildId: Snowflake | null; public get guild(): Guild | null; public cover: string | null; public flags: Readonly; public approximateGuildCount: number | null; public tags: string[]; public installParams: ClientApplicationInstallParams | null; public customInstallURL: string | null; public owner: User | Team | null; public get partial(): boolean; public roleConnectionsVerificationURL: string | null; public rpcOrigins: string[]; public fetch(): Promise; public fetchRoleConnectionMetadataRecords(): Promise; public editRoleConnectionMetadataRecords( records: ApplicationRoleConnectionMetadataEditOptions[], ): Promise; } export class ClientPresence extends Presence { private constructor(client: Client, data: RawPresenceData); private _parse(data: PresenceData): RawPresenceData; public set(presence: PresenceData): ClientPresence; } export class ClientUser extends User { public mfaEnabled: boolean; public get presence(): ClientPresence; public verified: boolean; public edit(options: ClientUserEditOptions): Promise; public setActivity(options?: ActivityOptions): ClientPresence; public setActivity(name: string, options?: Omit): ClientPresence; public setAFK(afk?: boolean, shardId?: number | number[]): ClientPresence; public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise; public setPresence(data: PresenceData): ClientPresence; public setStatus(status: PresenceStatusData, shardId?: number | number[]): ClientPresence; public setUsername(username: string): Promise; } export class Options extends null { private constructor(); private static userAgentAppendix: string; public static get DefaultMakeCacheSettings(): CacheWithLimitsOptions; public static get DefaultSweeperSettings(): SweeperOptions; public static createDefault(): ClientOptions; public static cacheWithLimits(settings?: CacheWithLimitsOptions): CacheFactory; public static cacheEverything(): CacheFactory; } export class ClientVoiceManager { private constructor(client: Client); public readonly client: Client; public adapters: Map; } export { Collection } from '@discordjs/collection'; export interface CollectorEventTypes { collect: [V, ...F]; ignore: [V, ...F]; dispose: [V, ...F]; end: [collected: Collection, reason: string]; } export abstract class Collector extends EventEmitter { protected constructor(client: Client, options?: CollectorOptions<[V, ...F]>); private _timeout: NodeJS.Timeout | null; private _idletimeout: NodeJS.Timeout | null; private _endReason: string | null; public readonly client: Client; public collected: Collection; public lastCollectedTimestamp: number | null; public get lastCollectedAt(): Date | null; public ended: boolean; public get endReason(): string | null; public filter: CollectorFilter<[V, ...F]>; public get next(): Promise; public options: CollectorOptions<[V, ...F]>; public checkEnd(): boolean; public handleCollect(...args: unknown[]): Promise; public handleDispose(...args: unknown[]): Promise; public stop(reason?: string): void; public resetTimer(options?: CollectorResetTimerOptions): void; public [Symbol.asyncIterator](): AsyncIterableIterator<[V, ...F]>; public toJSON(): unknown; protected listener: (...args: any[]) => void; public abstract collect(...args: unknown[]): K | null | Promise; public abstract dispose(...args: unknown[]): K | null; public on>( event: EventKey, listener: (...args: CollectorEventTypes[EventKey]) => Awaitable, ): this; public once>( event: EventKey, listener: (...args: CollectorEventTypes[EventKey]) => Awaitable, ): this; } export class ChatInputCommandInteraction extends CommandInteraction { public commandType: ApplicationCommandType.ChatInput; public options: Omit, 'getMessage' | 'getFocused'>; public inGuild(): this is ChatInputCommandInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ChatInputCommandInteraction<'cached'>; public inRawGuild(): this is ChatInputCommandInteraction<'raw'>; public toString(): string; } export class AutocompleteInteraction extends BaseInteraction { public type: InteractionType.ApplicationCommandAutocomplete; public get command(): ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null; public channelId: Snowflake; public commandId: Snowflake; public commandName: string; public commandType: ApplicationCommandType.ChatInput; public commandGuildId: Snowflake | null; public responded: boolean; public options: Omit< CommandInteractionOptionResolver, 'getMessage' | 'getUser' | 'getAttachment' | 'getChannel' | 'getMember' | 'getMentionable' | 'getRole' >; public inGuild(): this is AutocompleteInteraction<'raw' | 'cached'>; public inCachedGuild(): this is AutocompleteInteraction<'cached'>; public inRawGuild(): this is AutocompleteInteraction<'raw'>; public respond(options: ApplicationCommandOptionChoiceData[]): Promise; } export class CommandInteractionOptionResolver { private constructor( client: Client, options: CommandInteractionOption[], resolved: CommandInteractionResolvedData, ); public readonly client: Client; public readonly data: readonly CommandInteractionOption[]; public readonly resolved: Readonly> | null; private _group: string | null; private _hoistedOptions: CommandInteractionOption[]; private _subcommand: string | null; private _getTypedOption( name: string, allowedTypes: ApplicationCommandOptionType[], properties: (keyof ApplicationCommandOption)[], required: true, ): CommandInteractionOption; private _getTypedOption( name: string, allowedTypes: ApplicationCommandOptionType[], properties: (keyof ApplicationCommandOption)[], required: boolean, ): CommandInteractionOption | null; public get(name: string, required: true): CommandInteractionOption; public get(name: string, required?: boolean): CommandInteractionOption | null; public getSubcommand(required?: true): string; public getSubcommand(required: boolean): string | null; public getSubcommandGroup(required: true): string; public getSubcommandGroup(required?: boolean): string | null; public getBoolean(name: string, required: true): boolean; public getBoolean(name: string, required?: boolean): boolean | null; public getChannel( name: string, required: true, channelTypes?: readonly T[], ): Extract< NonNullable['channel']>, { // The `type` property of the PublicThreadChannel class is typed as `ChannelType.PublicThread | ChannelType.AnnouncementThread` // If the user only passed one of those channel types, the Extract<> would have resolved to `never` // Hence the need for this ternary type: T extends ChannelType.PublicThread | ChannelType.AnnouncementThread ? ChannelType.PublicThread | ChannelType.AnnouncementThread : T; } >; public getChannel( name: string, required?: boolean, channelTypes?: readonly T[], ): Extract< NonNullable['channel']>, { // The `type` property of the PublicThreadChannel class is typed as `ChannelType.PublicThread | ChannelType.AnnouncementThread` // If the user only passed one of those channel types, the Extract<> would have resolved to `never` // Hence the need for this ternary type: T extends ChannelType.PublicThread | ChannelType.AnnouncementThread ? ChannelType.PublicThread | ChannelType.AnnouncementThread : T; } > | null; public getString(name: string, required: true): string; public getString(name: string, required?: boolean): string | null; public getInteger(name: string, required: true): number; public getInteger(name: string, required?: boolean): number | null; public getNumber(name: string, required: true): number; public getNumber(name: string, required?: boolean): number | null; public getUser(name: string, required: true): NonNullable['user']>; public getUser(name: string, required?: boolean): NonNullable['user']> | null; public getMember(name: string): NonNullable['member']> | null; public getRole(name: string, required: true): NonNullable['role']>; public getRole(name: string, required?: boolean): NonNullable['role']> | null; public getAttachment(name: string, required: true): NonNullable['attachment']>; public getAttachment( name: string, required?: boolean, ): NonNullable['attachment']> | null; public getMentionable( name: string, required: true, ): NonNullable['member' | 'role' | 'user']>; public getMentionable( name: string, required?: boolean, ): NonNullable['member' | 'role' | 'user']> | null; public getMessage(name: string, required: true): NonNullable['message']>; public getMessage(name: string, required?: boolean): NonNullable['message']> | null; public getFocused(getFull: true): AutocompleteFocusedOption; public getFocused(getFull?: boolean): string; } export class ContextMenuCommandInteraction extends CommandInteraction { public commandType: ApplicationCommandType.Message | ApplicationCommandType.User; public options: Omit< CommandInteractionOptionResolver, | 'getFocused' | 'getMentionable' | 'getRole' | 'getNumber' | 'getInteger' | 'getString' | 'getChannel' | 'getBoolean' | 'getSubcommandGroup' | 'getSubcommand' >; public targetId: Snowflake; public inGuild(): this is ContextMenuCommandInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ContextMenuCommandInteraction<'cached'>; public inRawGuild(): this is ContextMenuCommandInteraction<'raw'>; private resolveContextMenuOptions(data: APIApplicationCommandInteractionData): CommandInteractionOption[]; } export interface ResolvedFile { data: Buffer; contentType?: string; } export class DataResolver extends null { private constructor(); public static resolveBase64(data: Base64Resolvable): string; public static resolveCode(data: string, regex: RegExp): string; public static resolveFile(resource: BufferResolvable | Stream): Promise; public static resolveImage(resource: BufferResolvable | Base64Resolvable): Promise; public static resolveInviteCode(data: InviteResolvable): string; public static resolveGuildTemplateCode(data: GuildTemplateResolvable): string; } export class DMChannel extends TextBasedChannelMixin(BaseChannel, false, [ 'bulkDelete', 'fetchWebhooks', 'createWebhook', 'setRateLimitPerUser', 'setNSFW', ]) { private constructor(client: Client, data?: RawDMChannelData); public flags: Readonly; public recipientId: Snowflake; public get recipient(): User | null; public type: ChannelType.DM; public fetch(force?: boolean): Promise; public toString(): UserMention; } export class Emoji extends Base { protected constructor(client: Client, emoji: RawEmojiData); public animated: boolean | null; public get createdAt(): Date | null; public get createdTimestamp(): number | null; public id: Snowflake | null; public name: string | null; public get identifier(): string; public get url(): string | null; public toJSON(): unknown; public toString(): string; } export class Guild extends AnonymousGuild { private constructor(client: Client, data: RawGuildData); private _sortedRoles(): Collection; private _sortedChannels(channel: NonThreadGuildBasedChannel): Collection; public get afkChannel(): VoiceChannel | null; public afkChannelId: Snowflake | null; public afkTimeout: number; public applicationId: Snowflake | null; public maxVideoChannelUsers: number | null; public approximateMemberCount: number | null; public approximatePresenceCount: number | null; public autoModerationRules: AutoModerationRuleManager; public available: boolean; public bans: GuildBanManager; public channels: GuildChannelManager; public commands: GuildApplicationCommandManager; public defaultMessageNotifications: GuildDefaultMessageNotifications; public discoverySplash: string | null; public emojis: GuildEmojiManager; public explicitContentFilter: GuildExplicitContentFilter; public invites: GuildInviteManager; public get joinedAt(): Date; public joinedTimestamp: number; public large: boolean; public maximumMembers: number | null; public maximumPresences: number | null; public maxStageVideoChannelUsers: number | null; public memberCount: number; public members: GuildMemberManager; public mfaLevel: GuildMFALevel; public ownerId: Snowflake; public preferredLocale: Locale; public premiumProgressBarEnabled: boolean; public premiumTier: GuildPremiumTier; public presences: PresenceManager; public get publicUpdatesChannel(): TextChannel | null; public publicUpdatesChannelId: Snowflake | null; public roles: RoleManager; public get rulesChannel(): TextChannel | null; public rulesChannelId: Snowflake | null; public get safetyAlertsChannel(): TextChannel | null; public safetyAlertsChannelId: Snowflake | null; public scheduledEvents: GuildScheduledEventManager; public get shard(): WebSocketShard; public shardId: number; public stageInstances: StageInstanceManager; public stickers: GuildStickerManager; public get systemChannel(): TextChannel | null; public systemChannelFlags: Readonly; public systemChannelId: Snowflake | null; public vanityURLUses: number | null; public get voiceAdapterCreator(): InternalDiscordGatewayAdapterCreator; public voiceStates: VoiceStateManager; public get widgetChannel(): TextChannel | NewsChannel | VoiceBasedChannel | ForumChannel | null; public widgetChannelId: Snowflake | null; public widgetEnabled: boolean | null; public get maximumBitrate(): number; public createTemplate(name: string, description?: string): Promise; public delete(): Promise; public discoverySplashURL(options?: ImageURLOptions): string | null; public edit(options: GuildEditOptions): Promise; public editWelcomeScreen(options: WelcomeScreenEditOptions): Promise; public equals(guild: Guild): boolean; public fetchAuditLogs( options?: GuildAuditLogsFetchOptions, ): Promise>; public fetchIntegrations(): Promise>; public fetchOnboarding(): Promise; public fetchOwner(options?: BaseFetchOptions): Promise; public fetchPreview(): Promise; public fetchTemplates(): Promise>; public fetchVanityData(): Promise; public fetchWebhooks(): Promise>; public fetchWelcomeScreen(): Promise; public fetchWidget(): Promise; public fetchWidgetSettings(): Promise; public leave(): Promise; public disableInvites(disabled?: boolean): Promise; public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise; public setAFKTimeout(afkTimeout: number, reason?: string): Promise; public setBanner(banner: BufferResolvable | Base64Resolvable | null, reason?: string): Promise; public setDefaultMessageNotifications( defaultMessageNotifications: GuildDefaultMessageNotifications | null, reason?: string, ): Promise; public setDiscoverySplash( discoverySplash: BufferResolvable | Base64Resolvable | null, reason?: string, ): Promise; public setExplicitContentFilter( explicitContentFilter: GuildExplicitContentFilter | null, reason?: string, ): Promise; public setIcon(icon: BufferResolvable | Base64Resolvable | null, reason?: string): Promise; public setName(name: string, reason?: string): Promise; public setOwner(owner: GuildMemberResolvable, reason?: string): Promise; public setPreferredLocale(preferredLocale: Locale | null, reason?: string): Promise; public setPublicUpdatesChannel(publicUpdatesChannel: TextChannelResolvable | null, reason?: string): Promise; public setRulesChannel(rulesChannel: TextChannelResolvable | null, reason?: string): Promise; public setSafetyAlertsChannel(safetyAlertsChannel: TextChannelResolvable | null, reason?: string): Promise; public setSplash(splash: BufferResolvable | Base64Resolvable | null, reason?: string): Promise; public setSystemChannel(systemChannel: TextChannelResolvable | null, reason?: string): Promise; public setSystemChannelFlags(systemChannelFlags: SystemChannelFlagsResolvable, reason?: string): Promise; public setVerificationLevel(verificationLevel: GuildVerificationLevel | null, reason?: string): Promise; public setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise; public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise; public setMFALevel(level: GuildMFALevel, reason?: string): Promise; public toJSON(): unknown; } export class GuildAuditLogs { private constructor(guild: Guild, data: RawGuildAuditLogData); private applicationCommands: Collection; private webhooks: Collection; private integrations: Collection; private guildScheduledEvents: Collection; private autoModerationRules: Collection; public entries: Collection>; public toJSON(): unknown; } export class GuildAuditLogsEntry< TAction extends GuildAuditLogsResolvable = AuditLogEvent, TActionType extends GuildAuditLogsActionType = TAction extends keyof GuildAuditLogsTypes ? GuildAuditLogsTypes[TAction][1] : GuildAuditLogsActionType, TTargetType extends GuildAuditLogsTargetType = TAction extends keyof GuildAuditLogsTypes ? GuildAuditLogsTypes[TAction][0] : GuildAuditLogsTargetType, TResolvedType = TAction extends null ? AuditLogEvent : TAction, > { private constructor(guild: Guild, data: RawGuildAuditLogEntryData, logs?: GuildAuditLogs); public static Targets: GuildAuditLogsTargets; public action: TResolvedType; public actionType: TActionType; public changes: AuditLogChange[]; public get createdAt(): Date; public get createdTimestamp(): number; public executorId: Snowflake | null; public executor: User | null; public extra: TResolvedType extends keyof GuildAuditLogsEntryExtraField ? GuildAuditLogsEntryExtraField[TResolvedType] : null; public id: Snowflake; public reason: string | null; public targetId: Snowflake | null; public target: TTargetType extends keyof GuildAuditLogsEntryTargetField ? GuildAuditLogsEntryTargetField[TTargetType] : Role | GuildEmoji | { id: Snowflake } | null; public targetType: TTargetType; public static actionType(action: AuditLogEvent): GuildAuditLogsActionType; public static targetType(target: AuditLogEvent): GuildAuditLogsTargetType; public toJSON(): unknown; } export class GuildBan extends Base { private constructor(client: Client, data: RawGuildBanData, guild: Guild); public guild: Guild; public user: User; public get partial(): boolean; public reason?: string | null; public fetch(force?: boolean): Promise; } export abstract class GuildChannel extends BaseChannel { public constructor(guild: Guild, data?: RawGuildChannelData, client?: Client, immediatePatch?: boolean); private memberPermissions(member: GuildMember, checkAdmin: boolean): Readonly; private rolePermissions(role: Role, checkAdmin: boolean): Readonly; public get createdAt(): Date; public get createdTimestamp(): number; public get deletable(): boolean; public flags: Readonly; public guild: Guild; public guildId: Snowflake; public get manageable(): boolean; public get members(): Collection; public name: string; public get parent(): CategoryChannel | null; public parentId: Snowflake | null; public permissionOverwrites: PermissionOverwriteManager; public get permissionsLocked(): boolean | null; public get position(): number; public rawPosition: number; public type: Exclude; public get viewable(): boolean; public clone(options?: GuildChannelCloneOptions): Promise; public delete(reason?: string): Promise; public edit(options: GuildChannelEditOptions): Promise; public equals(channel: GuildChannel): boolean; public lockPermissions(): Promise; public permissionsFor(memberOrRole: GuildMember | Role, checkAdmin?: boolean): Readonly; public permissionsFor( memberOrRole: GuildMemberResolvable | RoleResolvable, checkAdmin?: boolean, ): Readonly | null; public setName(name: string, reason?: string): Promise; public setParent(channel: CategoryChannelResolvable | null, options?: SetParentOptions): Promise; public setPosition(position: number, options?: SetChannelPositionOptions): Promise; public isTextBased(): this is GuildBasedChannel & TextBasedChannel; public toString(): ChannelMention; } export class GuildEmoji extends BaseGuildEmoji { private constructor(client: Client, data: RawGuildEmojiData, guild: Guild); private _roles: Snowflake[]; public get deletable(): boolean; public guild: Guild; public author: User | null; public get roles(): GuildEmojiRoleManager; public get url(): string; public delete(reason?: string): Promise; public edit(options: GuildEmojiEditOptions): Promise; public equals(other: GuildEmoji | unknown): boolean; public fetchAuthor(): Promise; public setName(name: string, reason?: string): Promise; } export type GuildMemberFlagsString = keyof typeof GuildMemberFlags; export type GuildMemberFlagsResolvable = BitFieldResolvable; export class GuildMemberFlagsBitField extends BitField { public static Flags: GuildMemberFlags; public static resolve(bit?: BitFieldResolvable): number; } export class GuildMember extends PartialTextBasedChannel(Base) { private constructor(client: Client, data: RawGuildMemberData, guild: Guild); private _roles: Snowflake[]; public avatar: string | null; public get bannable(): boolean; public get dmChannel(): DMChannel | null; public get displayColor(): number; public get displayHexColor(): HexColorString; public get displayName(): string; public guild: Guild; public get id(): Snowflake; public pending: boolean; public get communicationDisabledUntil(): Date | null; public communicationDisabledUntilTimestamp: number | null; public flags: Readonly; public get joinedAt(): Date | null; public joinedTimestamp: number | null; public get kickable(): boolean; public get manageable(): boolean; public get moderatable(): boolean; public nickname: string | null; public get partial(): false; public get permissions(): Readonly; public get premiumSince(): Date | null; public premiumSinceTimestamp: number | null; public get presence(): Presence | null; public get roles(): GuildMemberRoleManager; public user: User; public get voice(): VoiceState; public avatarURL(options?: ImageURLOptions): string | null; public ban(options?: BanOptions): Promise; public disableCommunicationUntil(timeout: DateResolvable | null, reason?: string): Promise; public timeout(timeout: number | null, reason?: string): Promise; public fetch(force?: boolean): Promise; public createDM(force?: boolean): Promise; public deleteDM(): Promise; public displayAvatarURL(options?: ImageURLOptions): string; public edit(options: GuildMemberEditOptions): Promise; public isCommunicationDisabled(): this is GuildMember & { communicationDisabledUntilTimestamp: number; readonly communicationDisabledUntil: Date; }; public kick(reason?: string): Promise; public permissionsIn(channel: GuildChannelResolvable): Readonly; public setFlags(flags: GuildMemberFlagsResolvable, reason?: string): Promise; public setNickname(nickname: string | null, reason?: string): Promise; public toJSON(): unknown; public toString(): UserMention; public valueOf(): string; } export class GuildOnboarding extends Base { private constructor(client: Client, data: RESTGetAPIGuildOnboardingResult); public get guild(): Guild; public guildId: Snowflake; public prompts: Collection; public defaultChannels: Collection; public enabled: boolean; } export class GuildOnboardingPrompt extends Base { private constructor(client: Client, data: APIGuildOnboardingPrompt, guildId: Snowflake); public id: Snowflake; public get guild(): Guild; public guildId: Snowflake; public options: Collection; public title: string; public singleSelect: boolean; public required: boolean; public inOnboarding: boolean; public type: GuildOnboardingPromptType; } export class GuildOnboardingPromptOption extends Base { private constructor(client: Client, data: APIGuildOnboardingPromptOption, guildId: Snowflake); public id: Snowflake; public get guild(): Guild; public guildId: Snowflake; public channels: Collection; public roles: Collection; public emoji: GuildOnboardingPromptOptionEmoji | null; public title: string; public description: string | null; } export class GuildPreview extends Base { private constructor(client: Client, data: RawGuildPreviewData); public approximateMemberCount: number; public approximatePresenceCount: number; public get createdAt(): Date; public get createdTimestamp(): number; public description: string | null; public discoverySplash: string | null; public emojis: Collection; public stickers: Collection; public features: `${GuildFeature}`[]; public icon: string | null; public id: Snowflake; public name: string; public splash: string | null; public discoverySplashURL(options?: ImageURLOptions): string | null; public iconURL(options?: ImageURLOptions): string | null; public splashURL(options?: ImageURLOptions): string | null; public fetch(): Promise; public toJSON(): unknown; public toString(): string; } export class GuildScheduledEvent extends Base { private constructor(client: Client, data: RawGuildScheduledEventData); public id: Snowflake; public guildId: Snowflake; public channelId: Snowflake | null; public creatorId: Snowflake | null; public name: string; public description: string | null; public scheduledStartTimestamp: number | null; public scheduledEndTimestamp: number | null; public privacyLevel: GuildScheduledEventPrivacyLevel; public status: S; public entityType: GuildScheduledEventEntityType; public entityId: Snowflake | null; public entityMetadata: GuildScheduledEventEntityMetadata | null; public userCount: number | null; public creator: User | null; public get createdTimestamp(): number; public get createdAt(): Date; public get scheduledStartAt(): Date | null; public get scheduledEndAt(): Date | null; public get channel(): VoiceChannel | StageChannel | null; public get guild(): Guild | null; public get url(): string; public image: string | null; public coverImageURL(options?: Readonly): string | null; public createInviteURL(options?: GuildScheduledEventInviteURLCreateOptions): Promise; public edit>( options: GuildScheduledEventEditOptions, ): Promise>; public delete(): Promise>; public setName(name: string, reason?: string): Promise>; public setScheduledStartTime(scheduledStartTime: DateResolvable, reason?: string): Promise>; public setScheduledEndTime(scheduledEndTime: DateResolvable, reason?: string): Promise>; public setDescription(description: string, reason?: string): Promise>; public setStatus>( status: T, reason?: string, ): Promise>; public setLocation(location: string, reason?: string): Promise>; public fetchSubscribers( options?: T, ): Promise>; public toString(): string; public isActive(): this is GuildScheduledEvent; public isCanceled(): this is GuildScheduledEvent; public isCompleted(): this is GuildScheduledEvent; public isScheduled(): this is GuildScheduledEvent; } export class GuildTemplate extends Base { private constructor(client: Client, data: RawGuildTemplateData); public createdTimestamp: number; public updatedTimestamp: number; public get url(): string; public code: string; public name: string; public description: string | null; public usageCount: number; public creator: User; public creatorId: Snowflake; public get createdAt(): Date; public get updatedAt(): Date; public get guild(): Guild | null; public guildId: Snowflake; public serializedGuild: APITemplateSerializedSourceGuild; public unSynced: boolean | null; public createGuild(name: string, icon?: BufferResolvable | Base64Resolvable): Promise; public delete(): Promise; public edit(options?: GuildTemplateEditOptions): Promise; public sync(): Promise; public static GuildTemplatesPattern: RegExp; } export class GuildPreviewEmoji extends BaseGuildEmoji { private constructor(client: Client, data: RawGuildEmojiData, guild: GuildPreview); public guild: GuildPreview; public roles: Snowflake[]; } export class Integration extends Base { private constructor(client: Client, data: RawIntegrationData, guild: Guild); public account: IntegrationAccount; public application: IntegrationApplication | null; public enabled: boolean | null; public expireBehavior: IntegrationExpireBehavior | null; public expireGracePeriod: number | null; public guild: Guild; public id: Snowflake | string; public name: string; public role: Role | null; public enableEmoticons: boolean | null; public get roles(): Collection; public scopes: OAuth2Scopes[]; public get syncedAt(): Date | null; public syncedTimestamp: number | null; public syncing: boolean | null; public type: IntegrationType; public user: User | null; public subscriberCount: number | null; public revoked: boolean | null; public delete(reason?: string): Promise; } export class IntegrationApplication extends Application { private constructor(client: Client, data: RawIntegrationApplicationData); public bot: User | null; public termsOfServiceURL: string | null; public privacyPolicyURL: string | null; public rpcOrigins: string[]; public hook: boolean | null; public cover: string | null; public verifyKey: string | null; } export type GatewayIntentsString = keyof typeof GatewayIntentBits; export class IntentsBitField extends BitField { public static Flags: typeof GatewayIntentBits; public static resolve(bit?: BitFieldResolvable): number; } export type CacheType = 'cached' | 'raw' | undefined; export type CacheTypeReducer< State extends CacheType, CachedType, RawType = CachedType, PresentType = CachedType | RawType, Fallback = PresentType | null, > = [State] extends ['cached'] ? CachedType : [State] extends ['raw'] ? RawType : [State] extends ['raw' | 'cached'] ? PresentType : Fallback; export type Interaction = | ChatInputCommandInteraction | MessageContextMenuCommandInteraction | UserContextMenuCommandInteraction | AnySelectMenuInteraction | ButtonInteraction | AutocompleteInteraction | ModalSubmitInteraction; export type RepliableInteraction = Exclude< Interaction, AutocompleteInteraction >; export class BaseInteraction extends Base { // This a technique used to brand different cached types. Or else we'll get `never` errors on typeguard checks. private readonly _cacheType: Cached; protected constructor(client: Client, data: RawInteractionData); public applicationId: Snowflake; public get channel(): CacheTypeReducer< Cached, GuildTextBasedChannel | null, GuildTextBasedChannel | null, GuildTextBasedChannel | null, TextBasedChannel | null >; public channelId: Snowflake | null; public get createdAt(): Date; public get createdTimestamp(): number; public get guild(): CacheTypeReducer; public guildId: CacheTypeReducer; public id: Snowflake; public member: CacheTypeReducer; public readonly token: string; public type: InteractionType; public user: User; public version: number; public appPermissions: CacheTypeReducer>; public memberPermissions: CacheTypeReducer>; public locale: Locale; public guildLocale: CacheTypeReducer; public inGuild(): this is BaseInteraction<'raw' | 'cached'>; public inCachedGuild(): this is BaseInteraction<'cached'>; public inRawGuild(): this is BaseInteraction<'raw'>; public isButton(): this is ButtonInteraction; public isAutocomplete(): this is AutocompleteInteraction; public isChatInputCommand(): this is ChatInputCommandInteraction; public isCommand(): this is CommandInteraction; public isContextMenuCommand(): this is ContextMenuCommandInteraction; public isMessageComponent(): this is MessageComponentInteraction; public isMessageContextMenuCommand(): this is MessageContextMenuCommandInteraction; public isModalSubmit(): this is ModalSubmitInteraction; public isUserContextMenuCommand(): this is UserContextMenuCommandInteraction; /** @deprecated Use {@link isStringSelectMenu} instead. */ public isSelectMenu(): this is StringSelectMenuInteraction; public isAnySelectMenu(): this is AnySelectMenuInteraction; public isStringSelectMenu(): this is StringSelectMenuInteraction; public isUserSelectMenu(): this is UserSelectMenuInteraction; public isRoleSelectMenu(): this is RoleSelectMenuInteraction; public isMentionableSelectMenu(): this is MentionableSelectMenuInteraction; public isChannelSelectMenu(): this is ChannelSelectMenuInteraction; public isRepliable(): this is RepliableInteraction; } export class InteractionCollector extends Collector< Snowflake, T, [Collection] > { public constructor(client: Client, options?: InteractionCollectorOptions); private _handleMessageDeletion(message: Message): void; private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void; private _handleGuildDeletion(guild: Guild): void; public channelId: Snowflake | null; public messageInteractionId: Snowflake | null; public componentType: ComponentType | null; public guildId: Snowflake | null; public interactionType: InteractionType | null; public messageId: Snowflake | null; public options: InteractionCollectorOptions; public total: number; public users: Collection; public collect(interaction: Interaction): Snowflake; public empty(): void; public dispose(interaction: Interaction): Snowflake; public on(event: 'collect' | 'dispose' | 'ignore', listener: (interaction: T) => Awaitable): this; public on(event: 'end', listener: (collected: Collection, reason: string) => Awaitable): this; public on(event: string, listener: (...args: any[]) => Awaitable): this; public once(event: 'collect' | 'dispose' | 'ignore', listener: (interaction: T) => Awaitable): this; public once(event: 'end', listener: (collected: Collection, reason: string) => Awaitable): this; public once(event: string, listener: (...args: any[]) => Awaitable): this; } export class InteractionWebhook extends PartialWebhookMixin() { public constructor(client: Client, id: Snowflake, token: string); public token: string; public send(options: string | MessagePayload | InteractionReplyOptions): Promise; public editMessage( message: MessageResolvable | '@original', options: string | MessagePayload | WebhookMessageEditOptions, ): Promise; public fetchMessage(message: Snowflake | '@original'): Promise; } export class Invite extends Base { private constructor(client: Client, data: RawInviteData); public channel: NonThreadGuildBasedChannel | PartialGroupDMChannel | null; public channelId: Snowflake | null; public code: string; public get deletable(): boolean; public get createdAt(): Date | null; public createdTimestamp: number | null; public get expiresAt(): Date | null; public get expiresTimestamp(): number | null; public guild: InviteGuild | Guild | null; public get inviter(): User | null; public inviterId: Snowflake | null; public maxAge: number | null; public maxUses: number | null; public memberCount: number; public presenceCount: number; public targetApplication: IntegrationApplication | null; public targetUser: User | null; public targetType: InviteTargetType | null; public temporary: boolean | null; public get url(): string; public uses: number | null; public delete(reason?: string): Promise; public toJSON(): unknown; public toString(): string; public static InvitesPattern: RegExp; /** @deprecated */ public stageInstance: InviteStageInstance | null; public guildScheduledEvent: GuildScheduledEvent | null; } /** @deprecated */ export class InviteStageInstance extends Base { private constructor(client: Client, data: RawInviteStageInstance, channelId: Snowflake, guildId: Snowflake); public channelId: Snowflake; public guildId: Snowflake; public members: Collection; public topic: string; public participantCount: number; public speakerCount: number; public get channel(): StageChannel | null; public get guild(): Guild | null; } export class InviteGuild extends AnonymousGuild { private constructor(client: Client, data: RawInviteGuildData); public welcomeScreen: WelcomeScreen | null; } export class LimitedCollection extends Collection { public constructor(options?: LimitedCollectionOptions, iterable?: Iterable); public maxSize: number; public keepOverLimit: ((value: V, key: K, collection: this) => boolean) | null; } export type MessageComponentType = Exclude; export type MessageCollectorOptionsParams = | { componentType?: T; } & MessageComponentCollectorOptions[T]>; export type MessageChannelCollectorOptionsParams = | { componentType?: T; } & MessageChannelComponentCollectorOptions[T]>; export type AwaitMessageCollectorOptionsParams = | { componentType?: T } & Pick< InteractionCollectorOptions[T]>, keyof AwaitMessageComponentOptions >; export interface StringMappedInteractionTypes { Button: ButtonInteraction; StringSelectMenu: StringSelectMenuInteraction; UserSelectMenu: UserSelectMenuInteraction; RoleSelectMenu: RoleSelectMenuInteraction; MentionableSelectMenu: MentionableSelectMenuInteraction; ChannelSelectMenu: ChannelSelectMenuInteraction; ActionRow: MessageComponentInteraction; } export type WrapBooleanCache = If; export interface MappedInteractionTypes { [ComponentType.Button]: ButtonInteraction>; [ComponentType.StringSelect]: StringSelectMenuInteraction>; [ComponentType.UserSelect]: UserSelectMenuInteraction>; [ComponentType.RoleSelect]: RoleSelectMenuInteraction>; [ComponentType.MentionableSelect]: MentionableSelectMenuInteraction>; [ComponentType.ChannelSelect]: ChannelSelectMenuInteraction>; } export class Message extends Base { private readonly _cacheType: InGuild; private constructor(client: Client, data: RawMessageData); private _patch(data: RawPartialMessageData | RawMessageData): void; public activity: MessageActivity | null; public applicationId: Snowflake | null; public attachments: Collection; public author: User; public get bulkDeletable(): boolean; public get channel(): If; public channelId: Snowflake; public get cleanContent(): string; public components: ActionRow[]; public content: string; public get createdAt(): Date; public createdTimestamp: number; public get crosspostable(): boolean; public get deletable(): boolean; public get editable(): boolean; public get editedAt(): Date | null; public editedTimestamp: number | null; public embeds: Embed[]; public groupActivityApplication: ClientApplication | null; public guildId: If; public get guild(): If; public get hasThread(): boolean; public id: Snowflake; public interaction: MessageInteraction | null; public get member(): GuildMember | null; public mentions: MessageMentions; public nonce: string | number | null; public get partial(): false; public get pinnable(): boolean; public pinned: boolean; public reactions: ReactionManager; public stickers: Collection; public position: number | null; public roleSubscriptionData: RoleSubscriptionData | null; public system: boolean; public get thread(): AnyThreadChannel | null; public tts: boolean; public type: MessageType; public get url(): string; public webhookId: Snowflake | null; public flags: Readonly; public reference: MessageReference | null; public awaitMessageComponent( options?: AwaitMessageCollectorOptionsParams, ): Promise[T]>; public awaitReactions(options?: AwaitReactionsOptions): Promise>; public createReactionCollector(options?: ReactionCollectorOptions): ReactionCollector; public createMessageComponentCollector( options?: MessageCollectorOptionsParams, ): InteractionCollector[T]>; public delete(): Promise>; public edit(content: string | MessageEditOptions | MessagePayload): Promise>; public equals(message: Message, rawData: unknown): boolean; public fetchReference(): Promise>; public fetchWebhook(): Promise; public crosspost(): Promise>; public fetch(force?: boolean): Promise>; public pin(reason?: string): Promise>; public react(emoji: EmojiIdentifierResolvable): Promise; public removeAttachments(): Promise>; public reply(options: string | MessagePayload | MessageReplyOptions): Promise>; public resolveComponent(customId: string): MessageActionRowComponent | null; public startThread(options: StartThreadOptions): Promise; public suppressEmbeds(suppress?: boolean): Promise>; public toJSON(): unknown; public toString(): string; public unpin(reason?: string): Promise>; public inGuild(): this is Message; } export class AttachmentBuilder { public constructor(attachment: BufferResolvable | Stream, data?: AttachmentData); public attachment: BufferResolvable | Stream; public description: string | null; public name: string | null; public get spoiler(): boolean; public setDescription(description: string): this; public setFile(attachment: BufferResolvable | Stream, name?: string): this; public setName(name: string): this; public setSpoiler(spoiler?: boolean): this; public toJSON(): unknown; public static from(other: JSONEncodable): AttachmentBuilder; } export class Attachment { private constructor(data: APIAttachment); private attachment: BufferResolvable | Stream; public contentType: string | null; public description: string | null; public duration: number | null; public ephemeral: boolean; public flags: AttachmentFlagsBitField; public height: number | null; public id: Snowflake; public name: string; public proxyURL: string; public size: number; public get spoiler(): boolean; public url: string; public waveform: string | null; public width: number | null; public toJSON(): unknown; } export type AttachmentFlagsString = keyof typeof AttachmentFlags; export class AttachmentFlagsBitField extends BitField { public static Flags: Record; public static resolve(bit?: BitFieldResolvable): number; } export class MessageCollector extends Collector]> { public constructor(channel: TextBasedChannel, options?: MessageCollectorOptions); private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void; private _handleGuildDeletion(guild: Guild): void; public channel: TextBasedChannel; public options: MessageCollectorOptions; public received: number; public collect(message: Message): Snowflake | null; public dispose(message: Message): Snowflake | null; } export class MessageComponentInteraction extends BaseInteraction { protected constructor(client: Client, data: RawMessageComponentInteractionData); public type: InteractionType.MessageComponent; public get component(): CacheTypeReducer< Cached, MessageActionRowComponent, Exclude>, MessageActionRowComponent | Exclude>, MessageActionRowComponent | Exclude> >; public componentType: Exclude; public customId: string; public channelId: Snowflake; public deferred: boolean; public ephemeral: boolean | null; public message: Message>; public replied: boolean; public webhook: InteractionWebhook; public inGuild(): this is MessageComponentInteraction<'raw' | 'cached'>; public inCachedGuild(): this is MessageComponentInteraction<'cached'>; public inRawGuild(): this is MessageComponentInteraction<'raw'>; public deferReply( options: InteractionDeferReplyOptions & { fetchReply: true }, ): Promise>>; public deferReply(options?: InteractionDeferReplyOptions): Promise>>; public deferUpdate( options: InteractionDeferUpdateOptions & { fetchReply: true }, ): Promise>>; public deferUpdate(options?: InteractionDeferUpdateOptions): Promise>>; public deleteReply(message?: MessageResolvable | '@original'): Promise; public editReply( options: string | MessagePayload | InteractionEditReplyOptions, ): Promise>>; public fetchReply(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise>>; public reply( options: string | MessagePayload | InteractionReplyOptions, ): Promise>>; public update(options: InteractionUpdateOptions & { fetchReply: true }): Promise>>; public update( options: string | MessagePayload | InteractionUpdateOptions, ): Promise>>; public showModal( modal: | JSONEncodable | ModalComponentData | APIModalInteractionResponseCallbackData, ): Promise; public awaitModalSubmit( options: AwaitModalSubmitOptions, ): Promise>; } export class MessageContextMenuCommandInteraction< Cached extends CacheType = CacheType, > extends ContextMenuCommandInteraction { public commandType: ApplicationCommandType.Message; public get targetMessage(): NonNullable['message']>; public inGuild(): this is MessageContextMenuCommandInteraction<'raw' | 'cached'>; public inCachedGuild(): this is MessageContextMenuCommandInteraction<'cached'>; public inRawGuild(): this is MessageContextMenuCommandInteraction<'raw'>; } export type MessageFlagsString = keyof typeof MessageFlags; export class MessageFlagsBitField extends BitField { public static Flags: typeof MessageFlags; public static resolve(bit?: BitFieldResolvable): number; } export class MessageMentions { private constructor( message: Message, users: APIUser[] | Collection, roles: Snowflake[] | Collection, everyone: boolean, repliedUser?: APIUser | User, ); private _channels: Collection | null; private readonly _content: string; private _members: Collection | null; private _parsedUsers: Collection | null; public get channels(): Collection; public readonly client: Client; public everyone: boolean; public readonly guild: If; public has(data: UserResolvable | RoleResolvable | ChannelResolvable, options?: MessageMentionsHasOptions): boolean; public get members(): If>; public get parsedUsers(): Collection; public repliedUser: User | null; public roles: Collection; public users: Collection; public crosspostedChannels: Collection; public toJSON(): unknown; private static GlobalChannelsPattern: RegExp; private static GlobalUsersPattern: RegExp; public static ChannelsPattern: typeof FormattingPatterns.Channel; public static EveryonePattern: RegExp; public static RolesPattern: typeof FormattingPatterns.Role; public static UsersPattern: typeof FormattingPatterns.User; } export type MessagePayloadOption = | MessageCreateOptions | MessageEditOptions | WebhookMessageCreateOptions | WebhookMessageEditOptions | InteractionReplyOptions | InteractionUpdateOptions; export class MessagePayload { public constructor(target: MessageTarget, options: MessagePayloadOption); public body: RawMessagePayloadData | null; public get isUser(): boolean; public get isWebhook(): boolean; public get isMessage(): boolean; public get isMessageManager(): boolean; public get isInteraction(): boolean; public files: RawFile[] | null; public options: MessagePayloadOption; public target: MessageTarget; public static create( target: MessageTarget, options: string | MessagePayloadOption, extra?: MessagePayloadOption, ): MessagePayload; public static resolveFile( fileLike: BufferResolvable | Stream | AttachmentPayload | JSONEncodable, ): Promise; public makeContent(): string | undefined; public resolveBody(): this; public resolveFiles(): Promise; } export class MessageReaction { private constructor(client: Client, data: RawMessageReactionData, message: Message); private _emoji: GuildEmoji | ReactionEmoji; public readonly client: Client; public count: number; public get emoji(): GuildEmoji | ReactionEmoji; public me: boolean; public message: Message | PartialMessage; public get partial(): false; public users: ReactionUserManager; public react(): Promise; public remove(): Promise; public fetch(): Promise; public toJSON(): unknown; public valueOf(): Snowflake | string; } export interface ModalComponentData { customId: string; title: string; components: ( | JSONEncodable> | ActionRowData )[]; } export interface BaseModalData { customId: string; type: ComponentType; } export interface TextInputModalData extends BaseModalData { type: ComponentType.TextInput; value: string; } export interface ActionRowModalData { type: ComponentType.ActionRow; components: TextInputModalData[]; } export class ModalSubmitFields { constructor(components: ModalActionRowComponent[][]); public components: ActionRowModalData[]; public fields: Collection; public getField(customId: string, type: T): { type: T } & TextInputModalData; public getField(customId: string, type?: ComponentType): TextInputModalData; public getTextInputValue(customId: string): string; } export interface ModalMessageModalSubmitInteraction extends ModalSubmitInteraction { message: Message>; channelId: Snowflake; update(options: InteractionUpdateOptions & { fetchReply: true }): Promise; update( options: string | MessagePayload | InteractionUpdateOptions, ): Promise>>; inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>; inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>; inRawGuild(): this is ModalMessageModalSubmitInteraction<'raw'>; } export class ModalSubmitInteraction extends BaseInteraction { private constructor(client: Client, data: APIModalSubmitInteraction); public type: InteractionType.ModalSubmit; public readonly customId: string; public readonly components: ActionRowModalData[]; public readonly fields: ModalSubmitFields; public deferred: boolean; public ephemeral: boolean | null; public message: Message> | null; public replied: boolean; public readonly webhook: InteractionWebhook; public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise>>; public reply( options: string | MessagePayload | InteractionReplyOptions, ): Promise>>; public deleteReply(message?: MessageResolvable | '@original'): Promise; public editReply( options: string | MessagePayload | InteractionEditReplyOptions, ): Promise>>; public deferReply( options: InteractionDeferReplyOptions & { fetchReply: true }, ): Promise>>; public deferReply(options?: InteractionDeferReplyOptions): Promise>>; public fetchReply(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; public deferUpdate( options: InteractionDeferUpdateOptions & { fetchReply: true }, ): Promise>>; public deferUpdate(options?: InteractionDeferUpdateOptions): Promise>>; public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ModalSubmitInteraction<'cached'>; public inRawGuild(): this is ModalSubmitInteraction<'raw'>; public isFromMessage(): this is ModalMessageModalSubmitInteraction; } export class NewsChannel extends BaseGuildTextChannel { public threads: GuildTextThreadManager; public type: ChannelType.GuildAnnouncement; public addFollower(channel: TextChannelResolvable, reason?: string): Promise; } export class OAuth2Guild extends BaseGuild { private constructor(client: Client, data: RawOAuth2GuildData); public owner: boolean; public permissions: Readonly; } export class PartialGroupDMChannel extends BaseChannel { private constructor(client: Client, data: RawPartialGroupDMChannelData); public type: ChannelType.GroupDM; public flags: null; public name: string | null; public icon: string | null; public recipients: PartialRecipient[]; public iconURL(options?: ImageURLOptions): string | null; public toString(): ChannelMention; } export interface GuildForumTagEmoji { id: Snowflake | null; name: string | null; } export interface GuildForumTag { id: Snowflake; name: string; moderated: boolean; emoji: GuildForumTagEmoji | null; } export type GuildForumTagData = Partial & { name: string }; export interface DefaultReactionEmoji { id: Snowflake | null; name: string | null; } export class ForumChannel extends TextBasedChannelMixin(GuildChannel, true, [ 'send', 'lastMessage', 'lastPinAt', 'bulkDelete', 'sendTyping', 'createMessageCollector', 'awaitMessages', 'createMessageComponentCollector', 'awaitMessageComponent', ]) { public type: ChannelType.GuildForum; public threads: GuildForumThreadManager; public availableTags: GuildForumTag[]; public defaultReactionEmoji: DefaultReactionEmoji | null; public defaultThreadRateLimitPerUser: number | null; public rateLimitPerUser: number | null; public defaultAutoArchiveDuration: ThreadAutoArchiveDuration | null; public nsfw: boolean; public topic: string | null; public defaultSortOrder: SortOrderType | null; public defaultForumLayout: ForumLayoutType; public setAvailableTags(tags: GuildForumTagData[], reason?: string): Promise; public setDefaultReactionEmoji(emojiId: DefaultReactionEmoji | null, reason?: string): Promise; public setDefaultThreadRateLimitPerUser(rateLimit: number, reason?: string): Promise; public createInvite(options?: InviteCreateOptions): Promise; public fetchInvites(cache?: boolean): Promise>; public setDefaultAutoArchiveDuration( defaultAutoArchiveDuration: ThreadAutoArchiveDuration, reason?: string, ): Promise; public setTopic(topic: string | null, reason?: string): Promise; public setDefaultSortOrder(defaultSortOrder: SortOrderType | null, reason?: string): Promise; public setDefaultForumLayout(defaultForumLayout: ForumLayoutType, reason?: string): Promise; } export class PermissionOverwrites extends Base { private constructor(client: Client, data: RawPermissionOverwriteData, channel: NonThreadGuildBasedChannel); public allow: Readonly; public readonly channel: NonThreadGuildBasedChannel; public deny: Readonly; public id: Snowflake; public type: OverwriteType; public edit(options: PermissionOverwriteOptions, reason?: string): Promise; public delete(reason?: string): Promise; public toJSON(): unknown; public static resolveOverwriteOptions( options: PermissionOverwriteOptions, initialPermissions: { allow?: PermissionResolvable; deny?: PermissionResolvable }, ): ResolvedOverwriteOptions; public static resolve(overwrite: OverwriteResolvable, guild: Guild): APIOverwrite; } export type PermissionsString = keyof typeof PermissionFlagsBits; export class PermissionsBitField extends BitField { public any(permission: PermissionResolvable, checkAdmin?: boolean): boolean; public has(permission: PermissionResolvable, checkAdmin?: boolean): boolean; public missing(bits: BitFieldResolvable, checkAdmin?: boolean): PermissionsString[]; public serialize(checkAdmin?: boolean): Record; public toArray(): PermissionsString[]; public static All: bigint; public static Default: bigint; public static StageModerator: bigint; public static Flags: typeof PermissionFlagsBits; public static resolve(permission?: PermissionResolvable): bigint; } export class Presence extends Base { protected constructor(client: Client, data?: RawPresenceData); public activities: Activity[]; public clientStatus: ClientPresenceStatusData | null; public guild: Guild | null; public get member(): GuildMember | null; public status: PresenceStatus; public get user(): User | null; public userId: Snowflake; public equals(presence: Presence): boolean; } export class ReactionCollector extends Collector { public constructor(message: Message, options?: ReactionCollectorOptions); private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void; private _handleGuildDeletion(guild: Guild): void; private _handleMessageDeletion(message: Message): void; public message: Message; public options: ReactionCollectorOptions; public total: number; public users: Collection; public static key(reaction: MessageReaction): Snowflake | string; public collect(reaction: MessageReaction, user: User): Snowflake | string | null; public dispose(reaction: MessageReaction, user: User): Snowflake | string | null; public empty(): void; public on( event: 'collect' | 'dispose' | 'remove' | 'ignore', listener: (reaction: MessageReaction, user: User) => void, ): this; public on(event: 'end', listener: (collected: Collection, reason: string) => void): this; public on(event: string, listener: (...args: any[]) => void): this; public once( event: 'collect' | 'dispose' | 'remove' | 'ignore', listener: (reaction: MessageReaction, user: User) => void, ): this; public once( event: 'end', listener: (collected: Collection, reason: string) => void, ): this; public once(event: string, listener: (...args: any[]) => void): this; } export class ReactionEmoji extends Emoji { private constructor(reaction: MessageReaction, emoji: RawReactionEmojiData); public reaction: MessageReaction; public toJSON(): unknown; } export class RichPresenceAssets { private constructor(activity: Activity, assets: RawRichPresenceAssets); public readonly activity: Activity; public largeImage: Snowflake | null; public largeText: string | null; public smallImage: Snowflake | null; public smallText: string | null; public largeImageURL(options?: ImageURLOptions): string | null; public smallImageURL(options?: ImageURLOptions): string | null; } export class Role extends Base { private constructor(client: Client, data: RawRoleData, guild: Guild); public color: number; public get createdAt(): Date; public get createdTimestamp(): number; public get editable(): boolean; public flags: RoleFlagsBitField; public guild: Guild; public get hexColor(): HexColorString; public hoist: boolean; public id: Snowflake; public managed: boolean; public get members(): Collection; public mentionable: boolean; public name: string; public permissions: Readonly; public get position(): number; public rawPosition: number; public tags: RoleTagData | null; public comparePositionTo(role: RoleResolvable): number; public icon: string | null; public unicodeEmoji: string | null; public delete(reason?: string): Promise; public edit(options: RoleEditOptions): Promise; public equals(role: Role): boolean; public iconURL(options?: ImageURLOptions): string | null; public permissionsIn( channel: NonThreadGuildBasedChannel | Snowflake, checkAdmin?: boolean, ): Readonly; public setColor(color: ColorResolvable, reason?: string): Promise; public setHoist(hoist?: boolean, reason?: string): Promise; public setMentionable(mentionable?: boolean, reason?: string): Promise; public setName(name: string, reason?: string): Promise; public setPermissions(permissions: PermissionResolvable, reason?: string): Promise; public setIcon(icon: BufferResolvable | Base64Resolvable | EmojiResolvable | null, reason?: string): Promise; public setPosition(position: number, options?: SetRolePositionOptions): Promise; public setUnicodeEmoji(unicodeEmoji: string | null, reason?: string): Promise; public toJSON(): unknown; public toString(): RoleMention; } export type RoleFlagsString = keyof typeof RoleFlags; export class RoleFlagsBitField extends BitField { public static Flags: typeof RoleFlags; public static resolve(bit?: BitFieldResolvable): number; } export class StringSelectMenuInteraction< Cached extends CacheType = CacheType, > extends MessageComponentInteraction { public constructor(client: Client, data: APIMessageStringSelectInteractionData); public get component(): CacheTypeReducer< Cached, StringSelectMenuComponent, APIStringSelectComponent, StringSelectMenuComponent | APIStringSelectComponent, StringSelectMenuComponent | APIStringSelectComponent >; public componentType: ComponentType.StringSelect; public values: string[]; public inGuild(): this is StringSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is StringSelectMenuInteraction<'cached'>; public inRawGuild(): this is StringSelectMenuInteraction<'raw'>; } export { /** @deprecated Use {@link StringSelectMenuInteraction} instead */ StringSelectMenuInteraction as SelectMenuInteraction, }; export class UserSelectMenuInteraction< Cached extends CacheType = CacheType, > extends MessageComponentInteraction { public constructor(client: Client, data: APIMessageUserSelectInteractionData); public get component(): CacheTypeReducer< Cached, UserSelectMenuComponent, APIUserSelectComponent, UserSelectMenuComponent | APIUserSelectComponent, UserSelectMenuComponent | APIUserSelectComponent >; public componentType: ComponentType.UserSelect; public values: Snowflake[]; public users: Collection; public members: Collection< Snowflake, CacheTypeReducer >; public inGuild(): this is UserSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is UserSelectMenuInteraction<'cached'>; public inRawGuild(): this is UserSelectMenuInteraction<'raw'>; } export class RoleSelectMenuInteraction< Cached extends CacheType = CacheType, > extends MessageComponentInteraction { public constructor(client: Client, data: APIMessageRoleSelectInteractionData); public get component(): CacheTypeReducer< Cached, RoleSelectMenuComponent, APIRoleSelectComponent, RoleSelectMenuComponent | APIRoleSelectComponent, RoleSelectMenuComponent | APIRoleSelectComponent >; public componentType: ComponentType.RoleSelect; public values: Snowflake[]; public roles: Collection>; public inGuild(): this is RoleSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is RoleSelectMenuInteraction<'cached'>; public inRawGuild(): this is RoleSelectMenuInteraction<'raw'>; } export class MentionableSelectMenuInteraction< Cached extends CacheType = CacheType, > extends MessageComponentInteraction { public constructor(client: Client, data: APIMessageMentionableSelectInteractionData); public get component(): CacheTypeReducer< Cached, MentionableSelectMenuComponent, APIMentionableSelectComponent, MentionableSelectMenuComponent | APIMentionableSelectComponent, MentionableSelectMenuComponent | APIMentionableSelectComponent >; public componentType: ComponentType.MentionableSelect; public values: Snowflake[]; public users: Collection; public members: Collection< Snowflake, CacheTypeReducer >; public roles: Collection>; public inGuild(): this is MentionableSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is MentionableSelectMenuInteraction<'cached'>; public inRawGuild(): this is MentionableSelectMenuInteraction<'raw'>; } export class ChannelSelectMenuInteraction< Cached extends CacheType = CacheType, > extends MessageComponentInteraction { public constructor(client: Client, data: APIMessageChannelSelectInteractionData); public get component(): CacheTypeReducer< Cached, ChannelSelectMenuComponent, APIChannelSelectComponent, ChannelSelectMenuComponent | APIChannelSelectComponent, ChannelSelectMenuComponent | APIChannelSelectComponent >; public componentType: ComponentType.ChannelSelect; public values: Snowflake[]; public channels: Collection< Snowflake, CacheTypeReducer >; public inGuild(): this is ChannelSelectMenuInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ChannelSelectMenuInteraction<'cached'>; public inRawGuild(): this is ChannelSelectMenuInteraction<'raw'>; } // Ideally this should be named SelectMenuInteraction, but that's the name of the "old" StringSelectMenuInteraction, meaning // the type name is reserved as a re-export to prevent a breaking change from being made, as such: // TODO: Rename this to SelectMenuInteraction in the next major export type AnySelectMenuInteraction = | StringSelectMenuInteraction | UserSelectMenuInteraction | RoleSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction; export type SelectMenuType = APISelectMenuComponent['type']; export interface ShardEventTypes { death: [process: ChildProcess | Worker]; disconnect: []; error: [error: Error]; message: [message: any]; ready: []; reconnecting: []; resume: []; spawn: [process: ChildProcess | Worker]; } export class Shard extends EventEmitter { private constructor(manager: ShardingManager, id: number); private _evals: Map>; private _exitListener: (...args: any[]) => void; private _fetches: Map>; private _handleExit(respawn?: boolean, timeout?: number): void; private _handleMessage(message: unknown): void; private incrementMaxListeners(emitter: EventEmitter | ChildProcess): void; private decrementMaxListeners(emitter: EventEmitter | ChildProcess): void; public args: string[]; public execArgv: string[]; public env: unknown; public id: number; public manager: ShardingManager; public process: ChildProcess | null; public ready: boolean; public silent: boolean; public worker: Worker | null; public eval(script: string): Promise; public eval(fn: (client: Client) => T): Promise; public eval(fn: (client: Client, context: Serialized

) => T, context: P): Promise; public fetchClientValue(prop: string): Promise; public kill(): void; public respawn(options?: { delay?: number; timeout?: number }): Promise; public send(message: unknown): Promise; public spawn(timeout?: number): Promise; public on( event: K, listener: (...args: ShardEventTypes[K]) => Awaitable, ): this; public once( event: K, listener: (...args: ShardEventTypes[K]) => Awaitable, ): this; } export class ShardClientUtil { private constructor(client: Client, mode: ShardingManagerMode); private _handleMessage(message: unknown): void; private _respond(type: string, message: unknown): void; private incrementMaxListeners(emitter: EventEmitter | ChildProcess): void; private decrementMaxListeners(emitter: EventEmitter | ChildProcess): void; public client: Client; public get count(): number; public get ids(): number[]; public mode: ShardingManagerMode; public parentPort: MessagePort | null; public broadcastEval(fn: (client: Client) => Awaitable): Promise[]>; public broadcastEval(fn: (client: Client) => Awaitable, options: { shard: number }): Promise>; public broadcastEval( fn: (client: Client, context: Serialized

) => Awaitable, options: { context: P }, ): Promise[]>; public broadcastEval( fn: (client: Client, context: Serialized

) => Awaitable, options: { context: P; shard: number }, ): Promise>; public fetchClientValues(prop: string): Promise; public fetchClientValues(prop: string, shard: number): Promise; public respawnAll(options?: MultipleShardRespawnOptions): Promise; public send(message: unknown): Promise; public static singleton(client: Client, mode: ShardingManagerMode): ShardClientUtil; public static shardIdForGuildId(guildId: Snowflake, shardCount: number): number; } export class ShardingManager extends EventEmitter { public constructor(file: string, options?: ShardingManagerOptions); private _performOnShards(method: string, args: unknown[]): Promise; private _performOnShards(method: string, args: unknown[], shard: number): Promise; public file: string; public respawn: boolean; public silent: boolean; public shardArgs: string[]; public shards: Collection; public token: string | null; public totalShards: number | 'auto'; public shardList: number[] | 'auto'; public broadcast(message: unknown): Promise; public broadcastEval(fn: (client: Client) => Awaitable): Promise[]>; public broadcastEval(fn: (client: Client) => Awaitable, options: { shard: number }): Promise>; public broadcastEval( fn: (client: Client, context: Serialized

) => Awaitable, options: { context: P }, ): Promise[]>; public broadcastEval( fn: (client: Client, context: Serialized

) => Awaitable, options: { context: P; shard: number }, ): Promise>; public createShard(id: number): Shard; public fetchClientValues(prop: string): Promise; public fetchClientValues(prop: string, shard: number): Promise; public respawnAll(options?: MultipleShardRespawnOptions): Promise>; public spawn(options?: MultipleShardSpawnOptions): Promise>; public on(event: 'shardCreate', listener: (shard: Shard) => Awaitable): this; public once(event: 'shardCreate', listener: (shard: Shard) => Awaitable): this; } export interface FetchRecommendedShardCountOptions { guildsPerShard?: number; multipleOf?: number; } export { DiscordSnowflake as SnowflakeUtil, SnowflakeGenerateOptions, DeconstructedSnowflake, } from '@sapphire/snowflake'; export class StageChannel extends BaseGuildVoiceChannel { public get stageInstance(): StageInstance | null; public topic: string | null; public type: ChannelType.GuildStageVoice; public createStageInstance(options: StageInstanceCreateOptions): Promise; public setTopic(topic: string): Promise; } export class DirectoryChannel extends BaseChannel { public flags: Readonly; public guild: InviteGuild; public guildId: Snowflake; public name: string; } export class StageInstance extends Base { private constructor(client: Client, data: RawStageInstanceData, channel: StageChannel); public id: Snowflake; public guildId: Snowflake; public channelId: Snowflake; public topic: string; public privacyLevel: StageInstancePrivacyLevel; /** @deprecated See https://github.com/discord/discord-api-docs/pull/4296 for more information */ public discoverableDisabled: boolean | null; public guildScheduledEventId?: Snowflake; public get channel(): StageChannel | null; public get guild(): Guild | null; public get guildScheduledEvent(): GuildScheduledEvent | null; public edit(options: StageInstanceEditOptions): Promise; public delete(): Promise; public setTopic(topic: string): Promise; public get createdTimestamp(): number; public get createdAt(): Date; } export class Sticker extends Base { private constructor(client: Client, data: RawStickerData); public get createdTimestamp(): number; public get createdAt(): Date; public available: boolean | null; public description: string | null; public format: StickerFormatType; public get guild(): Guild | null; public guildId: Snowflake | null; public id: Snowflake; public name: string; public packId: Snowflake | null; public get partial(): boolean; public sortValue: number | null; public tags: string | null; public type: StickerType | null; public user: User | null; public get url(): string; public fetch(): Promise; public fetchPack(): Promise; public fetchUser(): Promise; public edit(options?: GuildStickerEditOptions): Promise; public delete(reason?: string): Promise; public equals(other: Sticker | unknown): boolean; } export class StickerPack extends Base { private constructor(client: Client, data: RawStickerPackData); public get createdTimestamp(): number; public get createdAt(): Date; public bannerId: Snowflake | null; public get coverSticker(): Sticker | null; public coverStickerId: Snowflake | null; public description: string; public id: Snowflake; public name: string; public skuId: Snowflake; public stickers: Collection; public bannerURL(options?: ImageURLOptions): string | null; } export class Sweepers { public constructor(client: Client, options: SweeperOptions); public readonly client: Client; public intervals: Record; public options: SweeperOptions; public sweepApplicationCommands( filter: CollectionSweepFilter< SweeperDefinitions['applicationCommands'][0], SweeperDefinitions['applicationCommands'][1] >, ): number; public sweepAutoModerationRules( filter: CollectionSweepFilter< SweeperDefinitions['autoModerationRules'][0], SweeperDefinitions['autoModerationRules'][1] >, ): number; public sweepBans(filter: CollectionSweepFilter): number; public sweepEmojis( filter: CollectionSweepFilter, ): number; public sweepInvites( filter: CollectionSweepFilter, ): number; public sweepGuildMembers( filter: CollectionSweepFilter, ): number; public sweepMessages( filter: CollectionSweepFilter, ): number; public sweepPresences( filter: CollectionSweepFilter, ): number; public sweepReactions( filter: CollectionSweepFilter, ): number; public sweepStageInstances( filter: CollectionSweepFilter, ): number; public sweepStickers( filter: CollectionSweepFilter, ): number; public sweepThreadMembers( filter: CollectionSweepFilter, ): number; public sweepThreads( filter: CollectionSweepFilter, ): number; public sweepUsers( filter: CollectionSweepFilter, ): number; public sweepVoiceStates( filter: CollectionSweepFilter, ): number; public static archivedThreadSweepFilter( lifetime?: number, ): GlobalSweepFilter; public static expiredInviteSweepFilter( lifetime?: number, ): GlobalSweepFilter; public static filterByLifetime(options?: LifetimeFilterOptions): GlobalSweepFilter; public static outdatedMessageSweepFilter( lifetime?: number, ): GlobalSweepFilter; } export type SystemChannelFlagsString = keyof typeof GuildSystemChannelFlags; export class SystemChannelFlagsBitField extends BitField { public static Flags: typeof GuildSystemChannelFlags; public static resolve(bit?: BitFieldResolvable): number; } export class Team extends Base { private constructor(client: Client, data: RawTeamData); public id: Snowflake; public name: string; public icon: string | null; public ownerId: Snowflake | null; public members: Collection; public get owner(): TeamMember | null; public get createdAt(): Date; public get createdTimestamp(): number; public iconURL(options?: ImageURLOptions): string | null; public toJSON(): unknown; public toString(): string; } export class TeamMember extends Base { private constructor(team: Team, data: RawTeamMemberData); public team: Team; public get id(): Snowflake; public permissions: string[]; public membershipState: TeamMemberMembershipState; public user: User; public toString(): UserMention; } export class TextChannel extends BaseGuildTextChannel { public rateLimitPerUser: number; public threads: GuildTextThreadManager; public type: ChannelType.GuildText; } export type AnyThreadChannel = PublicThreadChannel | PrivateThreadChannel; export interface PublicThreadChannel extends ThreadChannel { type: ChannelType.PublicThread | ChannelType.AnnouncementThread; } export interface PrivateThreadChannel extends ThreadChannel { get createdTimestamp(): number; get createdAt(): Date; type: ChannelType.PrivateThread; } export class ThreadChannel extends TextBasedChannelMixin(BaseChannel, true, [ 'fetchWebhooks', 'createWebhook', 'setNSFW', ]) { private constructor(guild: Guild, data?: RawThreadChannelData, client?: Client); public archived: boolean | null; public get archivedAt(): Date | null; public archiveTimestamp: number | null; public get createdAt(): Date | null; private _createdTimestamp: number | null; public get createdTimestamp(): number | null; public autoArchiveDuration: ThreadAutoArchiveDuration | null; public get editable(): boolean; public flags: Readonly; public guild: Guild; public guildId: Snowflake; public get guildMembers(): Collection; public invitable: boolean | null; public get joinable(): boolean; public get joined(): boolean; public locked: boolean | null; public get manageable(): boolean; public get viewable(): boolean; public get sendable(): boolean; public memberCount: number | null; public messageCount: number | null; public appliedTags: Snowflake[]; public totalMessageSent: number | null; public members: ThreadMemberManager; public name: string; public ownerId: Snowflake | null; public get parent(): If | null; public parentId: Snowflake | null; public rateLimitPerUser: number | null; public type: ThreadChannelType; public get unarchivable(): boolean; public delete(reason?: string): Promise; public edit(options: ThreadEditOptions): Promise; public join(): Promise; public leave(): Promise; public permissionsFor(memberOrRole: GuildMember | Role, checkAdmin?: boolean): Readonly; public permissionsFor( memberOrRole: GuildMemberResolvable | RoleResolvable, checkAdmin?: boolean, ): Readonly | null; public fetchOwner(options?: BaseFetchOptions): Promise; public fetchStarterMessage(options?: BaseFetchOptions): Promise | null>; public setArchived(archived?: boolean, reason?: string): Promise; public setAutoArchiveDuration( autoArchiveDuration: ThreadAutoArchiveDuration, reason?: string, ): Promise; public setInvitable(invitable?: boolean, reason?: string): Promise; public setLocked(locked?: boolean, reason?: string): Promise; public setName(name: string, reason?: string): Promise; // The following 3 methods can only be run on forum threads. public setAppliedTags(appliedTags: Snowflake[], reason?: string): Promise>; public pin(reason?: string): Promise>; public unpin(reason?: string): Promise>; public toString(): ChannelMention; } export class ThreadMember extends Base { private constructor(thread: ThreadChannel, data: RawThreadMemberData, extra?: unknown); public flags: ThreadMemberFlagsBitField; private member: If; public get guildMember(): HasMemberData extends true ? GuildMember : GuildMember | null; public id: Snowflake; public get joinedAt(): Date | null; public joinedTimestamp: number | null; public get manageable(): boolean; public thread: AnyThreadChannel; public get user(): User | null; public get partial(): false; public remove(reason?: string): Promise; } export type ThreadMemberFlagsString = keyof typeof ThreadMemberFlags; export class ThreadMemberFlagsBitField extends BitField { public static Flags: typeof ThreadMemberFlags; public static resolve(bit?: BitFieldResolvable): number; } export class Typing extends Base { private constructor(channel: TextBasedChannel, user: PartialUser, data?: RawTypingData); public channel: TextBasedChannel; public user: User | PartialUser; public startedTimestamp: number; public get startedAt(): Date; public get guild(): Guild | null; public get member(): GuildMember | null; public inGuild(): this is this & { channel: TextChannel | NewsChannel | ThreadChannel; get guild(): Guild; }; } export class User extends PartialTextBasedChannel(Base) { protected constructor(client: Client, data: RawUserData); private _equals(user: APIUser): boolean; public accentColor: number | null | undefined; public avatar: string | null; public avatarDecoration: string | null; public banner: string | null | undefined; public bot: boolean; public get createdAt(): Date; public get createdTimestamp(): number; public discriminator: string; public get displayName(): string; public get defaultAvatarURL(): string; public get dmChannel(): DMChannel | null; public flags: Readonly | null; public globalName: string | null; public get hexAccentColor(): HexColorString | null | undefined; public id: Snowflake; public get partial(): false; public system: boolean; public get tag(): string; public username: string; public avatarURL(options?: ImageURLOptions): string | null; public avatarDecorationURL(options?: BaseImageURLOptions): string | null; public bannerURL(options?: ImageURLOptions): string | null | undefined; public createDM(force?: boolean): Promise; public deleteDM(): Promise; public displayAvatarURL(options?: ImageURLOptions): string; public equals(user: User): boolean; public fetch(force?: boolean): Promise; public fetchFlags(force?: boolean): Promise; public toString(): UserMention; } export class UserContextMenuCommandInteraction< Cached extends CacheType = CacheType, > extends ContextMenuCommandInteraction { public commandType: ApplicationCommandType.User; public get targetUser(): User; public get targetMember(): CacheTypeReducer; public inGuild(): this is UserContextMenuCommandInteraction<'raw' | 'cached'>; public inCachedGuild(): this is UserContextMenuCommandInteraction<'cached'>; public inRawGuild(): this is UserContextMenuCommandInteraction<'raw'>; } export type UserFlagsString = keyof typeof UserFlags; export class UserFlagsBitField extends BitField { public static Flags: typeof UserFlags; public static resolve(bit?: BitFieldResolvable): number; } export function basename(path: string, ext?: string): string; export function cleanContent(str: string, channel: TextBasedChannel): string; export function discordSort( collection: Collection, ): Collection; export function cleanCodeBlockContent(text: string): string; export function fetchRecommendedShardCount(token: string, options?: FetchRecommendedShardCountOptions): Promise; export function flatten(obj: unknown, ...props: Record[]): unknown; export function makeError(obj: MakeErrorOptions): Error; export function makePlainError(err: Error): MakeErrorOptions; export function mergeDefault(def: unknown, given: unknown): unknown; export function moveElementInArray(array: unknown[], element: unknown, newIndex: number, offset?: boolean): number; export function parseEmoji(text: string): { animated: boolean; name: string; id: Snowflake | null } | null; export function resolveColor(color: ColorResolvable): number; export function resolvePartialEmoji(emoji: EmojiIdentifierResolvable): Partial | null; export function verifyString(data: string, error?: typeof Error, errorMessage?: string, allowEmpty?: boolean): string; export function setPosition( item: T, position: number, relative: boolean, sorted: Collection, client: Client, route: string, reason?: string, ): Promise<{ id: Snowflake; position: number }[]>; export function parseWebhookURL(url: string): WebhookClientDataIdWithToken | null; export interface MappedComponentBuilderTypes { [ComponentType.Button]: ButtonBuilder; [ComponentType.StringSelect]: StringSelectMenuBuilder; [ComponentType.UserSelect]: UserSelectMenuBuilder; [ComponentType.RoleSelect]: RoleSelectMenuBuilder; [ComponentType.MentionableSelect]: MentionableSelectMenuBuilder; [ComponentType.ChannelSelect]: ChannelSelectMenuBuilder; [ComponentType.ActionRow]: ActionRowBuilder; [ComponentType.TextInput]: TextInputBuilder; } export interface MappedComponentTypes { [ComponentType.Button]: ButtonComponent; [ComponentType.StringSelect]: StringSelectMenuComponent; [ComponentType.UserSelect]: UserSelectMenuComponent; [ComponentType.RoleSelect]: RoleSelectMenuComponent; [ComponentType.MentionableSelect]: MentionableSelectMenuComponent; [ComponentType.ChannelSelect]: ChannelSelectMenuComponent; [ComponentType.ActionRow]: ActionRowComponent; [ComponentType.TextInput]: TextInputComponent; } export interface ChannelCreateOptions { allowFromUnknownGuild?: boolean; } export function createChannel(client: Client, data: APIChannel, options?: ChannelCreateOptions): Channel; export function createComponent( data: APIMessageComponent & { type: T }, ): MappedComponentTypes[T]; export function createComponent(data: C): C; export function createComponent(data: APIMessageComponent | Component): Component; export function createComponentBuilder( data: APIMessageComponent & { type: T }, ): MappedComponentBuilderTypes[T]; export function createComponentBuilder(data: C): C; export function createComponentBuilder(data: APIMessageComponent | ComponentBuilder): ComponentBuilder; /** @deprecated This class is redundant as all methods of the class can be imported from discord.js directly. */ export class Formatters extends null { /** @deprecated Import this method directly from discord.js instead. */ public static blockQuote: typeof blockQuote; /** @deprecated Import this method directly from discord.js instead. */ public static bold: typeof bold; /** @deprecated Import this method directly from discord.js instead. */ public static channelMention: typeof channelMention; /** @deprecated Import this method directly from discord.js instead. */ public static codeBlock: typeof codeBlock; /** @deprecated Import this method directly from discord.js instead. */ public static formatEmoji: typeof formatEmoji; /** @deprecated Import this method directly from discord.js instead. */ public static hideLinkEmbed: typeof hideLinkEmbed; /** @deprecated Import this method directly from discord.js instead. */ public static hyperlink: typeof hyperlink; /** @deprecated Import this method directly from discord.js instead. */ public static inlineCode: typeof inlineCode; /** @deprecated Import this method directly from discord.js instead. */ public static italic: typeof italic; /** @deprecated Import this method directly from discord.js instead. */ public static quote: typeof quote; /** @deprecated Import this method directly from discord.js instead. */ public static roleMention: typeof roleMention; /** @deprecated Import this method directly from discord.js instead. */ public static spoiler: typeof spoiler; /** @deprecated Import this method directly from discord.js instead. */ public static strikethrough: typeof strikethrough; /** @deprecated Import this method directly from discord.js instead. */ public static time: typeof time; /** @deprecated Import this property directly from discord.js instead. */ public static TimestampStyles: typeof TimestampStyles; /** @deprecated Import this method directly from discord.js instead. */ public static underscore: typeof underscore; /** @deprecated Import this method directly from discord.js instead. */ public static userMention: typeof userMention; } export type ComponentData = | MessageActionRowComponentData | ModalActionRowComponentData | ActionRowData; export class VoiceChannel extends BaseGuildVoiceChannel { public get speakable(): boolean; public type: ChannelType.GuildVoice; } export class VoiceRegion { private constructor(data: RawVoiceRegionData); public custom: boolean; public deprecated: boolean; public id: string; public name: string; public optimal: boolean; public toJSON(): unknown; } export class VoiceState extends Base { private constructor(guild: Guild, data: RawVoiceStateData); public get channel(): VoiceBasedChannel | null; public channelId: Snowflake | null; public get deaf(): boolean | null; public guild: Guild; public id: Snowflake; public get member(): GuildMember | null; public get mute(): boolean | null; public selfDeaf: boolean | null; public selfMute: boolean | null; public serverDeaf: boolean | null; public serverMute: boolean | null; public sessionId: string | null; public streaming: boolean | null; public selfVideo: boolean | null; public suppress: boolean | null; public requestToSpeakTimestamp: number | null; public setDeaf(deaf?: boolean, reason?: string): Promise; public setMute(mute?: boolean, reason?: string): Promise; public disconnect(reason?: string): Promise; public setChannel(channel: GuildVoiceChannelResolvable | null, reason?: string): Promise; public setRequestToSpeak(request?: boolean): Promise; public setSuppressed(suppressed?: boolean): Promise; public edit(options: VoiceStateEditOptions): Promise; } export class Webhook extends WebhookMixin() { private constructor(client: Client, data?: RawWebhookData); public avatar: string | null; public avatarURL(options?: ImageURLOptions): string | null; public channelId: Snowflake; public readonly client: Client; public guildId: Snowflake; public name: string; public owner: User | APIUser | null; public sourceGuild: Guild | APIPartialGuild | null; public sourceChannel: NewsChannel | APIPartialChannel | null; public token: string | null; public type: WebhookType; public applicationId: Snowflake | null; public get channel(): TextChannel | VoiceChannel | NewsChannel | ForumChannel | StageChannel | null; public isUserCreated(): this is this & { type: WebhookType.Incoming; applicationId: null; owner: User | APIUser; }; public isApplicationCreated(): this is this & { type: WebhookType.Application; applicationId: Snowflake; owner: User | APIUser; }; public isIncoming(): this is this & { type: WebhookType.Incoming; token: string; }; public isChannelFollower(): this is this & { type: WebhookType.ChannelFollower; sourceGuild: Guild | APIPartialGuild; sourceChannel: NewsChannel | APIPartialChannel; token: null; applicationId: null; owner: User | APIUser; }; public editMessage( message: MessageResolvable, options: string | MessagePayload | WebhookMessageEditOptions, ): Promise; public fetchMessage(message: Snowflake, options?: WebhookFetchMessageOptions): Promise; public send(options: string | MessagePayload | WebhookMessageCreateOptions): Promise; } export class WebhookClient extends WebhookMixin(BaseClient) { public constructor(data: WebhookClientData, options?: WebhookClientOptions); public readonly client: this; public options: WebhookClientOptions; public token: string; public editMessage( message: MessageResolvable, options: string | MessagePayload | WebhookMessageEditOptions, ): Promise; public fetchMessage(message: Snowflake, options?: WebhookFetchMessageOptions): Promise; public send(options: string | MessagePayload | WebhookMessageCreateOptions): Promise; } export class WebSocketManager extends EventEmitter { private constructor(client: Client); private readonly packetQueue: unknown[]; private destroyed: boolean; public readonly client: Client; public gateway: string | null; public shards: Collection; public status: Status; public get ping(): number; public on(event: GatewayDispatchEvents, listener: (data: any, shardId: number) => void): this; public once(event: GatewayDispatchEvents, listener: (data: any, shardId: number) => void): this; private debug(message: string, shardId?: number): void; private connect(): Promise; private broadcast(packet: unknown): void; private destroy(): Promise; private handlePacket(packet?: unknown, shard?: WebSocketShard): boolean; private checkShardsReady(): void; private triggerClientReady(): void; } export interface WebSocketShardEventTypes { ready: []; resumed: []; invalidSession: []; destroyed: []; close: [event: CloseEvent]; allReady: [unavailableGuilds?: Set]; } export class WebSocketShard extends EventEmitter { private constructor(manager: WebSocketManager, id: number); private closeSequence: number; private sessionInfo: SessionInfo | null; public lastPingTimestamp: number; private expectedGuilds: Set | null; private readyTimeout: NodeJS.Timeout | null; public manager: WebSocketManager; public id: number; public status: Status; public ping: number; private debug(message: string): void; private onReadyPacket(packet: unknown): void; private gotGuild(guildId: Snowflake): void; private checkReady(): void; private emitClose(event?: CloseEvent): void; public send(data: unknown, important?: boolean): void; public on( event: K, listener: (...args: WebSocketShardEventTypes[K]) => Awaitable, ): this; public once( event: K, listener: (...args: WebSocketShardEventTypes[K]) => Awaitable, ): this; } export class Widget extends Base { private constructor(client: Client, data: RawWidgetData); private _patch(data: RawWidgetData): void; public fetch(): Promise; public id: Snowflake; public name: string; public instantInvite?: string; public channels: Collection; public members: Collection; public presenceCount: number; } export class WidgetMember extends Base { private constructor(client: Client, data: RawWidgetMemberData); public id: string; public username: string; public discriminator: string; public avatar: string | null; public status: PresenceStatus; public deaf: boolean | null; public mute: boolean | null; public selfDeaf: boolean | null; public selfMute: boolean | null; public suppress: boolean | null; public channelId: Snowflake | null; public avatarURL: string; public activity: WidgetActivity | null; } export class WelcomeChannel extends Base { private constructor(guild: Guild, data: RawWelcomeChannelData); private _emoji: Omit; public channelId: Snowflake; public guild: Guild | InviteGuild; public description: string; public get channel(): TextChannel | NewsChannel | ForumChannel | null; public get emoji(): GuildEmoji | Emoji; } export class WelcomeScreen extends Base { private constructor(guild: Guild, data: RawWelcomeScreenData); public get enabled(): boolean; public guild: Guild | InviteGuild; public description: string | null; public welcomeChannels: Collection; } //#endregion //#region Constants export type NonSystemMessageType = | MessageType.Default | MessageType.Reply | MessageType.ChatInputCommand | MessageType.ContextMenuCommand; export type DeletableMessageType = | MessageType.AutoModerationAction | MessageType.ChannelFollowAdd | MessageType.ChannelPinnedMessage | MessageType.ChatInputCommand | MessageType.ContextMenuCommand | MessageType.Default | MessageType.GuildBoost | MessageType.GuildBoostTier1 | MessageType.GuildBoostTier2 | MessageType.GuildBoostTier3 | MessageType.GuildInviteReminder | MessageType.InteractionPremiumUpsell | MessageType.Reply | MessageType.RoleSubscriptionPurchase | MessageType.StageEnd | MessageType.StageRaiseHand | MessageType.StageSpeaker | MessageType.StageStart | MessageType.StageTopic | MessageType.ThreadCreated | MessageType.UserJoin; export const Constants: { MaxBulkDeletableMessageAge: 1_209_600_000; SweeperKeys: SweeperKey[]; NonSystemMessageTypes: NonSystemMessageType[]; TextBasedChannelTypes: TextBasedChannelTypes[]; GuildTextBasedChannelTypes: GuildTextBasedChannelTypes[]; ThreadChannelTypes: ThreadChannelType[]; VoiceBasedChannelTypes: VoiceBasedChannelTypes[]; SelectMenuTypes: SelectMenuType[]; DeletableMessageTypes: DeletableMessageType[]; StickerFormatExtensionMap: Record; }; export const version: string; //#endregion //#region Errors export enum DiscordjsErrorCodes { ClientInvalidOption = 'ClientInvalidOption', ClientInvalidProvidedShards = 'ClientInvalidProvidedShards', ClientMissingIntents = 'ClientMissingIntents', ClientNotReady = 'ClientNotReady', TokenInvalid = 'TokenInvalid', TokenMissing = 'TokenMissing', ApplicationCommandPermissionsTokenMissing = 'ApplicationCommandPermissionsTokenMissing', /** @deprecated */ WSCloseRequested = 'WSCloseRequested', /** @deprecated */ WSConnectionExists = 'WSConnectionExists', /** @deprecated */ WSNotOpen = 'WSNotOpen', ManagerDestroyed = 'ManagerDestroyed', BitFieldInvalid = 'BitFieldInvalid', /** @deprecated */ ShardingInvalid = 'ShardingInvalid', /** @deprecated */ ShardingRequired = 'ShardingRequired', /** @deprecated */ InvalidIntents = 'InvalidIntents', /** @deprecated */ DisallowedIntents = 'DisallowedIntents', ShardingNoShards = 'ShardingNoShards', ShardingInProcess = 'ShardingInProcess', ShardingInvalidEvalBroadcast = 'ShardingInvalidEvalBroadcast', ShardingShardNotFound = 'ShardingShardNotFound', ShardingAlreadySpawned = 'ShardingAlreadySpawned', ShardingProcessExists = 'ShardingProcessExists', ShardingWorkerExists = 'ShardingWorkerExists', ShardingReadyTimeout = 'ShardingReadyTimeout', ShardingReadyDisconnected = 'ShardingReadyDisconnected', ShardingReadyDied = 'ShardingReadyDied', ShardingNoChildExists = 'ShardingNoChildExists', ShardingShardMiscalculation = 'ShardingShardMiscalculation', ColorRange = 'ColorRange', ColorConvert = 'ColorConvert', InviteOptionsMissingChannel = 'InviteOptionsMissingChannel', ButtonLabel = 'ButtonLabel', ButtonURL = 'ButtonURL', ButtonCustomId = 'ButtonCustomId', SelectMenuCustomId = 'SelectMenuCustomId', SelectMenuPlaceholder = 'SelectMenuPlaceholder', SelectOptionLabel = 'SelectOptionLabel', SelectOptionValue = 'SelectOptionValue', SelectOptionDescription = 'SelectOptionDescription', InteractionCollectorError = 'InteractionCollectorError', FileNotFound = 'FileNotFound', UserBannerNotFetched = 'UserBannerNotFetched', UserNoDMChannel = 'UserNoDMChannel', VoiceNotStageChannel = 'VoiceNotStageChannel', VoiceStateNotOwn = 'VoiceStateNotOwn', VoiceStateInvalidType = 'VoiceStateInvalidType', ReqResourceType = 'ReqResourceType', ImageFormat = 'ImageFormat', ImageSize = 'ImageSize', MessageBulkDeleteType = 'MessageBulkDeleteType', MessageNonceType = 'MessageNonceType', MessageContentType = 'MessageContentType', SplitMaxLen = 'SplitMaxLen', BanResolveId = 'BanResolveId', FetchBanResolveId = 'FetchBanResolveId', PruneDaysType = 'PruneDaysType', GuildChannelResolve = 'GuildChannelResolve', GuildVoiceChannelResolve = 'GuildVoiceChannelResolve', GuildChannelOrphan = 'GuildChannelOrphan', GuildChannelUnowned = 'GuildChannelUnowned', GuildOwned = 'GuildOwned', GuildMembersTimeout = 'GuildMembersTimeout', GuildUncachedMe = 'GuildUncachedMe', ChannelNotCached = 'ChannelNotCached', StageChannelResolve = 'StageChannelResolve', GuildScheduledEventResolve = 'GuildScheduledEventResolve', FetchOwnerId = 'FetchOwnerId', InvalidType = 'InvalidType', InvalidElement = 'InvalidElement', MessageThreadParent = 'MessageThreadParent', MessageExistingThread = 'MessageExistingThread', ThreadInvitableType = 'ThreadInvitableType', WebhookMessage = 'WebhookMessage', WebhookTokenUnavailable = 'WebhookTokenUnavailable', WebhookURLInvalid = 'WebhookURLInvalid', WebhookApplication = 'WebhookApplication', MessageReferenceMissing = 'MessageReferenceMissing', EmojiType = 'EmojiType', EmojiManaged = 'EmojiManaged', MissingManageGuildExpressionsPermission = 'MissingManageGuildExpressionsPermission', /** @deprecated Use {@link MissingManageGuildExpressionsPermission} instead. */ MissingManageEmojisAndStickersPermission = 'MissingManageEmojisAndStickersPermission', NotGuildSticker = 'NotGuildSticker', ReactionResolveUser = 'ReactionResolveUser', VanityURL = 'VanityURL', InviteResolveCode = 'InviteResolveCode', InviteNotFound = 'InviteNotFound', DeleteGroupDMChannel = 'DeleteGroupDMChannel', FetchGroupDMChannel = 'FetchGroupDMChannel', MemberFetchNonceLength = 'MemberFetchNonceLength', GlobalCommandPermissions = 'GlobalCommandPermissions', GuildUncachedEntityResolve = 'GuildUncachedEntityResolve', InteractionAlreadyReplied = 'InteractionAlreadyReplied', InteractionNotReplied = 'InteractionNotReplied', /** @deprecated */ InteractionEphemeralReplied = 'InteractionEphemeralReplied', CommandInteractionOptionNotFound = 'CommandInteractionOptionNotFound', CommandInteractionOptionType = 'CommandInteractionOptionType', CommandInteractionOptionEmpty = 'CommandInteractionOptionEmpty', CommandInteractionOptionNoSubcommand = 'CommandInteractionOptionNoSubcommand', CommandInteractionOptionNoSubcommandGroup = 'CommandInteractionOptionNoSubcommandGroup', AutocompleteInteractionOptionNoFocusedOption = 'AutocompleteInteractionOptionNoFocusedOption', ModalSubmitInteractionFieldNotFound = 'ModalSubmitInteractionFieldNotFound', ModalSubmitInteractionFieldType = 'ModalSubmitInteractionFieldType', InvalidMissingScopes = 'InvalidMissingScopes', InvalidScopesWithPermissions = 'InvalidScopesWithPermissions', NotImplemented = 'NotImplemented', SweepFilterReturn = 'SweepFilterReturn', GuildForumMessageRequired = 'GuildForumMessageRequired', } export interface DiscordjsErrorFields { readonly name: `${Name} [${DiscordjsErrorCodes}]`; get code(): DiscordjsErrorCodes; } export function DiscordjsErrorMixin( Base: Constructable, name: N, ): Constructable>; export class DiscordjsError extends DiscordjsErrorMixin(Error, 'Error') {} export class DiscordjsTypeError extends DiscordjsErrorMixin(TypeError, 'TypeError') {} export class DiscordjsRangeError extends DiscordjsErrorMixin(RangeError, 'RangeError') {} //#endregion //#region Managers export abstract class BaseManager { protected constructor(client: Client); public readonly client: Client; } export abstract class DataManager extends BaseManager { protected constructor(client: Client, holds: Constructable); public readonly holds: Constructable; public get cache(): Collection; public resolve(resolvable: Holds): Holds; public resolve(resolvable: R): Holds | null; public resolveId(resolvable: K | Holds): K; public resolveId(resolvable: R): K | null; public valueOf(): Collection; } export abstract class CachedManager extends DataManager { protected constructor(client: Client, holds: Constructable, iterable?: Iterable); private readonly _cache: Collection; private _add(data: unknown, cache?: boolean, { id, extras }?: { id: K; extras: unknown[] }): Holds; } export type ApplicationCommandDataResolvable = | ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody | JSONEncodable; export class ApplicationCommandManager< ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>, PermissionsOptionsExtras = { guild: GuildResolvable }, PermissionsGuildType = null, > extends CachedManager { protected constructor(client: Client, iterable?: Iterable); public permissions: ApplicationCommandPermissionsManager< { command?: ApplicationCommandResolvable } & PermissionsOptionsExtras, { command: ApplicationCommandResolvable } & PermissionsOptionsExtras, PermissionsGuildType, null >; private commandPath({ id, guildId }: { id?: Snowflake; guildId?: Snowflake }): string; public create(command: ApplicationCommandDataResolvable, guildId?: Snowflake): Promise; public delete(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise; public edit( command: ApplicationCommandResolvable, data: Partial, ): Promise; public edit( command: ApplicationCommandResolvable, data: Partial, guildId: Snowflake, ): Promise; public fetch( id: Snowflake, options: FetchApplicationCommandOptions & { guildId: Snowflake }, ): Promise; public fetch(options: FetchApplicationCommandOptions): Promise>; public fetch(id: Snowflake, options?: FetchApplicationCommandOptions): Promise; public fetch( id?: Snowflake, options?: FetchApplicationCommandOptions, ): Promise>; public set( commands: readonly ApplicationCommandDataResolvable[], ): Promise>; public set( commands: readonly ApplicationCommandDataResolvable[], guildId: Snowflake, ): Promise>; private static transformCommand(command: ApplicationCommandDataResolvable): RESTPostAPIApplicationCommandsJSONBody; } export class ApplicationCommandPermissionsManager< BaseOptions, FetchSingleOptions, GuildType, CommandIdType, > extends BaseManager { private constructor(manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand); private manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand; public commandId: CommandIdType; public guild: GuildType; public guildId: Snowflake | null; public add( options: FetchSingleOptions & EditApplicationCommandPermissionsMixin, ): Promise; public has( options: FetchSingleOptions & { permissionId: ApplicationCommandPermissionIdResolvable; permissionType?: ApplicationCommandPermissionType; }, ): Promise; public fetch(options: FetchSingleOptions): Promise; public fetch(options: BaseOptions): Promise>; public remove( options: | (FetchSingleOptions & { token: string; channels?: readonly (GuildChannelResolvable | ChannelPermissionConstant)[]; roles?: readonly (RoleResolvable | RolePermissionConstant)[]; users: readonly UserResolvable[]; }) | (FetchSingleOptions & { token: string; channels?: readonly (GuildChannelResolvable | ChannelPermissionConstant)[]; roles: readonly (RoleResolvable | RolePermissionConstant)[]; users?: readonly UserResolvable[]; }) | (FetchSingleOptions & { token: string; channels: readonly (GuildChannelResolvable | ChannelPermissionConstant)[]; roles?: readonly (RoleResolvable | RolePermissionConstant)[]; users?: readonly UserResolvable[]; }), ): Promise; public set( options: FetchSingleOptions & EditApplicationCommandPermissionsMixin, ): Promise; private permissionsPath(guildId: Snowflake, commandId?: Snowflake): string; } export class AutoModerationRuleManager extends CachedManager< Snowflake, AutoModerationRule, AutoModerationRuleResolvable > { private constructor(guild: Guild, iterable: unknown); public guild: Guild; public create(options: AutoModerationRuleCreateOptions): Promise; public edit( autoModerationRule: AutoModerationRuleResolvable, options: AutoModerationRuleEditOptions, ): Promise; public fetch(options: AutoModerationRuleResolvable | FetchAutoModerationRuleOptions): Promise; public fetch(options?: FetchAutoModerationRulesOptions): Promise>; public delete(autoModerationRule: AutoModerationRuleResolvable, reason?: string): Promise; } export class BaseGuildEmojiManager extends CachedManager { protected constructor(client: Client, iterable?: Iterable); public resolveIdentifier(emoji: EmojiIdentifierResolvable): string | null; } export class CategoryChannelChildManager extends DataManager { private constructor(channel: CategoryChannel); public channel: CategoryChannel; public get guild(): Guild; public create( options: CategoryCreateChannelOptions & { type: T }, ): Promise; public create(options: CategoryCreateChannelOptions): Promise; } export class ChannelManager extends CachedManager { private constructor(client: Client, iterable: Iterable); public fetch(id: Snowflake, options?: FetchChannelOptions): Promise; } export type FetchGuildApplicationCommandFetchOptions = Omit; export class GuildApplicationCommandManager extends ApplicationCommandManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public create(command: ApplicationCommandDataResolvable): Promise; public delete(command: ApplicationCommandResolvable): Promise; public edit( command: ApplicationCommandResolvable, data: Partial, ): Promise; public fetch(id: Snowflake, options?: FetchGuildApplicationCommandFetchOptions): Promise; public fetch(options: FetchGuildApplicationCommandFetchOptions): Promise>; public fetch( id?: undefined, options?: FetchGuildApplicationCommandFetchOptions, ): Promise>; public set(commands: ApplicationCommandDataResolvable[]): Promise>; } export type MappedGuildChannelTypes = { [ChannelType.GuildCategory]: CategoryChannel; } & MappedChannelCategoryTypes; export type GuildChannelTypes = CategoryChannelType | ChannelType.GuildCategory; export class GuildChannelManager extends CachedManager { private constructor(guild: Guild, iterable?: Iterable); public get channelCountWithoutThreads(): number; public guild: Guild; public addFollower( channel: NewsChannel | Snowflake, targetChannel: TextChannelResolvable, reason?: string, ): Promise; public create( options: GuildChannelCreateOptions & { type: T }, ): Promise; public create(options: GuildChannelCreateOptions): Promise; public createWebhook(options: WebhookCreateOptions): Promise; public edit(channel: GuildChannelResolvable, data: GuildChannelEditOptions): Promise; public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; public fetch( id?: undefined, options?: BaseFetchOptions, ): Promise>; public fetchWebhooks(channel: GuildChannelResolvable): Promise>; public setPosition( channel: GuildChannelResolvable, position: number, options?: SetChannelPositionOptions, ): Promise; public setPositions(channelPositions: readonly ChannelPosition[]): Promise; public fetchActiveThreads(cache?: boolean): Promise; private rawFetchGuildActiveThreads(): Promise; public delete(channel: GuildChannelResolvable, reason?: string): Promise; } export class GuildEmojiManager extends BaseGuildEmojiManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public create(options: GuildEmojiCreateOptions): Promise; public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; public fetch(id?: undefined, options?: BaseFetchOptions): Promise>; public fetchAuthor(emoji: EmojiResolvable): Promise; public delete(emoji: EmojiResolvable, reason?: string): Promise; public edit(emoji: EmojiResolvable, options: GuildEmojiEditOptions): Promise; } export class GuildEmojiRoleManager extends DataManager { private constructor(emoji: GuildEmoji); public emoji: GuildEmoji; public guild: Guild; public add( roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection, ): Promise; public set(roles: readonly RoleResolvable[] | Collection): Promise; public remove( roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection, ): Promise; } export class GuildManager extends CachedManager { private constructor(client: Client, iterable?: Iterable); public create(options: GuildCreateOptions): Promise; public fetch(options: Snowflake | FetchGuildOptions): Promise; public fetch(options?: FetchGuildsOptions): Promise>; } export interface AddOrRemoveGuildMemberRoleOptions { user: GuildMemberResolvable; role: RoleResolvable; reason?: string; } export class GuildMemberManager extends CachedManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public get me(): GuildMember | null; public add( user: UserResolvable, options: AddGuildMemberOptions & { fetchWhenExisting: false }, ): Promise; public add(user: UserResolvable, options: AddGuildMemberOptions): Promise; public ban(user: UserResolvable, options?: BanOptions): Promise; public edit(user: UserResolvable, options: GuildMemberEditOptions): Promise; public fetch( options: UserResolvable | FetchMemberOptions | (FetchMembersOptions & { user: UserResolvable }), ): Promise; public fetch(options?: FetchMembersOptions): Promise>; public fetchMe(options?: BaseFetchOptions): Promise; public kick(user: UserResolvable, reason?: string): Promise; public list(options?: GuildListMembersOptions): Promise>; public prune(options: GuildPruneMembersOptions & { dry?: false; count: false }): Promise; public prune(options?: GuildPruneMembersOptions): Promise; public search(options: GuildSearchMembersOptions): Promise>; public unban(user: UserResolvable, reason?: string): Promise; public addRole(options: AddOrRemoveGuildMemberRoleOptions): Promise; public removeRole(options: AddOrRemoveGuildMemberRoleOptions): Promise; } export class GuildBanManager extends CachedManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public create(user: UserResolvable, options?: BanOptions): Promise; public fetch(options: UserResolvable | FetchBanOptions): Promise; public fetch(options?: FetchBansOptions): Promise>; public remove(user: UserResolvable, reason?: string): Promise; } export class GuildInviteManager extends DataManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public create(channel: GuildInvitableChannelResolvable, options?: InviteCreateOptions): Promise; public fetch(options: InviteResolvable | FetchInviteOptions): Promise; public fetch(options?: FetchInvitesOptions): Promise>; public delete(invite: InviteResolvable, reason?: string): Promise; } export class GuildScheduledEventManager extends CachedManager< Snowflake, GuildScheduledEvent, GuildScheduledEventResolvable > { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public create(options: GuildScheduledEventCreateOptions): Promise; public fetch(): Promise>; public fetch< T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions | FetchGuildScheduledEventsOptions, >(options?: T): Promise>; public edit>( guildScheduledEvent: GuildScheduledEventResolvable, options: GuildScheduledEventEditOptions, ): Promise>; public delete(guildScheduledEvent: GuildScheduledEventResolvable): Promise; public fetchSubscribers( guildScheduledEvent: GuildScheduledEventResolvable, options?: T, ): Promise>; } export class GuildStickerManager extends CachedManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public create(options: GuildStickerCreateOptions): Promise; public edit(sticker: StickerResolvable, data?: GuildStickerEditOptions): Promise; public delete(sticker: StickerResolvable, reason?: string): Promise; public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; public fetch(id?: Snowflake, options?: BaseFetchOptions): Promise>; public fetchUser(sticker: StickerResolvable): Promise; } export class GuildMemberRoleManager extends DataManager { private constructor(member: GuildMember); public get hoist(): Role | null; public get icon(): Role | null; public get color(): Role | null; public get highest(): Role; public get premiumSubscriberRole(): Role | null; public get botRole(): Role | null; public member: GuildMember; public guild: Guild; public add( roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection, reason?: string, ): Promise; public set(roles: readonly RoleResolvable[] | Collection, reason?: string): Promise; public remove( roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection, reason?: string, ): Promise; } export abstract class MessageManager extends CachedManager< Snowflake, Message, MessageResolvable > { protected constructor(channel: TextBasedChannel, iterable?: Iterable); public channel: TextBasedChannel; public delete(message: MessageResolvable): Promise; public edit( message: MessageResolvable, options: string | MessagePayload | MessageEditOptions, ): Promise>; public fetch(options: MessageResolvable | FetchMessageOptions): Promise>; public fetch(options?: FetchMessagesOptions): Promise>>; public fetchPinned(cache?: boolean): Promise>>; public react(message: MessageResolvable, emoji: EmojiIdentifierResolvable): Promise; public pin(message: MessageResolvable, reason?: string): Promise; public unpin(message: MessageResolvable, reason?: string): Promise; } export class DMMessageManager extends MessageManager { public channel: DMChannel; } export class GuildMessageManager extends MessageManager { public channel: GuildTextBasedChannel; public crosspost(message: MessageResolvable): Promise>; } export class PermissionOverwriteManager extends CachedManager< Snowflake, PermissionOverwrites, PermissionOverwriteResolvable > { private constructor(client: Client, iterable?: Iterable); public set( overwrites: readonly OverwriteResolvable[] | Collection, reason?: string, ): Promise; private upsert( userOrRole: RoleResolvable | UserResolvable, options: PermissionOverwriteOptions, overwriteOptions?: GuildChannelOverwriteOptions, existing?: PermissionOverwrites, ): Promise; public create( userOrRole: RoleResolvable | UserResolvable, options: PermissionOverwriteOptions, overwriteOptions?: GuildChannelOverwriteOptions, ): Promise; public edit( userOrRole: RoleResolvable | UserResolvable, options: PermissionOverwriteOptions, overwriteOptions?: GuildChannelOverwriteOptions, ): Promise; public delete(userOrRole: RoleResolvable | UserResolvable, reason?: string): Promise; } export class PresenceManager extends CachedManager { private constructor(client: Client, iterable?: Iterable); } export class ReactionManager extends CachedManager { private constructor(message: Message, iterable?: Iterable); public message: Message; public removeAll(): Promise; } export class ReactionUserManager extends CachedManager { private constructor(reaction: MessageReaction, iterable?: Iterable); public reaction: MessageReaction; public fetch(options?: FetchReactionUsersOptions): Promise>; public remove(user?: UserResolvable): Promise; } export class RoleManager extends CachedManager { private constructor(guild: Guild, iterable?: Iterable); public get everyone(): Role; public get highest(): Role; public guild: Guild; public get premiumSubscriberRole(): Role | null; public botRoleFor(user: UserResolvable): Role | null; public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; public fetch(id?: undefined, options?: BaseFetchOptions): Promise>; public create(options?: RoleCreateOptions): Promise; public edit(role: RoleResolvable, options: RoleEditOptions): Promise; public delete(role: RoleResolvable, reason?: string): Promise; public setPosition(role: RoleResolvable, position: number, options?: SetRolePositionOptions): Promise; public setPositions(rolePositions: readonly RolePosition[]): Promise; public comparePositions(role1: RoleResolvable, role2: RoleResolvable): number; } export class StageInstanceManager extends CachedManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; public create(channel: StageChannelResolvable, options: StageInstanceCreateOptions): Promise; public fetch(channel: StageChannelResolvable, options?: BaseFetchOptions): Promise; public edit(channel: StageChannelResolvable, options: StageInstanceEditOptions): Promise; public delete(channel: StageChannelResolvable): Promise; } export class ThreadManager extends CachedManager< Snowflake, ThreadChannel, ThreadChannelResolvable > { protected constructor(channel: TextChannel | NewsChannel | ForumChannel, iterable?: Iterable); public channel: If; public fetch(options: ThreadChannelResolvable, cacheOptions?: BaseFetchOptions): Promise; public fetch( options: FetchThreadsOptions & { archived: FetchArchivedThreadOptions }, cacheOptions?: { cache?: boolean }, ): Promise; public fetch(options?: FetchThreadsOptions, cacheOptions?: { cache?: boolean }): Promise; public fetchArchived(options?: FetchArchivedThreadOptions, cache?: boolean): Promise; public fetchActive(cache?: boolean): Promise; } export class GuildTextThreadManager extends ThreadManager { public create(options: GuildTextThreadCreateOptions): Promise; } export class GuildForumThreadManager extends ThreadManager { public create(options: GuildForumThreadCreateOptions): Promise; } export class ThreadMemberManager extends CachedManager { private constructor(thread: ThreadChannel, iterable?: Iterable); public thread: AnyThreadChannel; public get me(): ThreadMember | null; public add(member: UserResolvable | '@me', reason?: string): Promise; public fetch( options: ThreadMember | ((FetchThreadMemberOptions & { withMember: true }) | { member: ThreadMember }), ): Promise>; public fetch(options: ThreadMemberResolvable | FetchThreadMemberOptions): Promise; public fetch( options: FetchThreadMembersWithGuildMemberDataOptions, ): Promise>>; public fetch(options?: FetchThreadMembersWithoutGuildMemberDataOptions): Promise>; public fetchMe(options?: BaseFetchOptions): Promise; public remove(id: Snowflake | '@me', reason?: string): Promise; } export class UserManager extends CachedManager { private constructor(client: Client, iterable?: Iterable); private dmChannel(userId: Snowflake): DMChannel | null; public createDM(user: UserResolvable, options?: BaseFetchOptions): Promise; public deleteDM(user: UserResolvable): Promise; public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise; public fetchFlags(user: UserResolvable, options?: BaseFetchOptions): Promise; public send(user: UserResolvable, options: string | MessagePayload | MessageCreateOptions): Promise; } export class VoiceStateManager extends CachedManager { private constructor(guild: Guild, iterable?: Iterable); public guild: Guild; } //#endregion //#region Mixins // Model the TextBasedChannel mixin system, allowing application of these fields // to the classes that use these methods without having to manually add them // to each of those classes export type Constructable = abstract new (...args: any[]) => T; export function PartialTextBasedChannel( Base?: Constructable, ): Constructable>; export function TextBasedChannelMixin< T, InGuild extends boolean = boolean, I extends keyof TextBasedChannelFields = never, >( Base?: Constructable, inGuild?: InGuild, ignore?: I[], ): Constructable, I>>; export interface PartialTextBasedChannelFields { send(options: string | MessagePayload | MessageCreateOptions): Promise>; } export interface TextBasedChannelFields extends PartialTextBasedChannelFields { lastMessageId: Snowflake | null; get lastMessage(): Message | null; lastPinTimestamp: number | null; get lastPinAt(): Date | null; messages: If; awaitMessageComponent( options?: AwaitMessageCollectorOptionsParams, ): Promise; awaitMessages(options?: AwaitMessagesOptions): Promise>; bulkDelete( messages: Collection | readonly MessageResolvable[] | number, filterOld?: boolean, ): Promise>; createMessageComponentCollector( options?: MessageChannelCollectorOptionsParams, ): InteractionCollector; createMessageCollector(options?: MessageCollectorOptions): MessageCollector; createWebhook(options: ChannelWebhookCreateOptions): Promise; fetchWebhooks(): Promise>; sendTyping(): Promise; setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise; setNSFW(nsfw?: boolean, reason?: string): Promise; } export function PartialWebhookMixin(Base?: Constructable): Constructable; export function WebhookMixin(Base?: Constructable): Constructable; export interface PartialWebhookFields { id: Snowflake; get url(): string; deleteMessage(message: MessageResolvable | APIMessage | '@original', threadId?: Snowflake): Promise; editMessage( message: MessageResolvable | '@original', options: string | MessagePayload | WebhookMessageEditOptions, ): Promise; fetchMessage(message: Snowflake | '@original', options?: WebhookFetchMessageOptions): Promise; send( options: string | MessagePayload | InteractionReplyOptions | WebhookMessageCreateOptions, ): Promise; } export interface WebhookFields extends PartialWebhookFields { get createdAt(): Date; get createdTimestamp(): number; delete(reason?: string): Promise; edit(options: WebhookEditOptions): Promise; sendSlackMessage(body: unknown): Promise; } //#endregion //#region Typedefs export type ActivitiesOptions = Omit; export interface ActivityOptions { name: string; state?: string; url?: string; type?: ActivityType; shardId?: number | readonly number[]; } export interface AddGuildMemberOptions { accessToken: string; nick?: string; roles?: Collection | RoleResolvable[]; mute?: boolean; deaf?: boolean; force?: boolean; fetchWhenExisting?: boolean; } export type AllowedPartial = User | Channel | GuildMember | Message | MessageReaction | ThreadMember; export type AllowedThreadTypeForNewsChannel = ChannelType.AnnouncementThread; export type AllowedThreadTypeForTextChannel = ChannelType.PublicThread | ChannelType.PrivateThread; export interface BaseApplicationCommandData { name: string; nameLocalizations?: LocalizationMap; dmPermission?: boolean; defaultMemberPermissions?: PermissionResolvable | null; nsfw?: boolean; } export interface AttachmentData { name?: string; description?: string; } export type CommandOptionDataTypeResolvable = ApplicationCommandOptionType; export type CommandOptionChannelResolvableType = ApplicationCommandOptionType.Channel; export type CommandOptionChoiceResolvableType = | ApplicationCommandOptionType.String | CommandOptionNumericResolvableType; export type CommandOptionNumericResolvableType = | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Integer; export type CommandOptionSubOptionResolvableType = | ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup; export type CommandOptionNonChoiceResolvableType = Exclude< CommandOptionDataTypeResolvable, CommandOptionChoiceResolvableType | CommandOptionSubOptionResolvableType | CommandOptionChannelResolvableType >; export interface BaseApplicationCommandOptionsData { name: string; nameLocalizations?: LocalizationMap; description: string; descriptionLocalizations?: LocalizationMap; required?: boolean; autocomplete?: never; } export interface UserApplicationCommandData extends BaseApplicationCommandData { type: ApplicationCommandType.User; } export interface MessageApplicationCommandData extends BaseApplicationCommandData { type: ApplicationCommandType.Message; } export interface ChatInputApplicationCommandData extends BaseApplicationCommandData { description: string; descriptionLocalizations?: LocalizationMap; type?: ApplicationCommandType.ChatInput; options?: readonly ApplicationCommandOptionData[]; } export type ApplicationCommandData = | UserApplicationCommandData | MessageApplicationCommandData | ChatInputApplicationCommandData; export interface ApplicationCommandChannelOptionData extends BaseApplicationCommandOptionsData { type: CommandOptionChannelResolvableType; channelTypes?: readonly ApplicationCommandOptionAllowedChannelTypes[]; channel_types?: readonly ApplicationCommandOptionAllowedChannelTypes[]; } export interface ApplicationCommandChannelOption extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Channel; channelTypes?: readonly ApplicationCommandOptionAllowedChannelTypes[]; } export interface ApplicationCommandRoleOptionData extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Role; } export interface ApplicationCommandRoleOption extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Role; } export interface ApplicationCommandUserOptionData extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.User; } export interface ApplicationCommandUserOption extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.User; } export interface ApplicationCommandMentionableOptionData extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Mentionable; } export interface ApplicationCommandMentionableOption extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Mentionable; } export interface ApplicationCommandAttachmentOption extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Attachment; } export interface ApplicationCommandAutocompleteNumericOption extends Omit { type: CommandOptionNumericResolvableType; minValue?: number; maxValue?: number; autocomplete: true; } export interface ApplicationCommandAutocompleteStringOption extends Omit { type: ApplicationCommandOptionType.String; minLength?: number; maxLength?: number; autocomplete: true; } export interface ApplicationCommandAutocompleteNumericOptionData extends Omit { type: CommandOptionNumericResolvableType; minValue?: number; min_value?: number; maxValue?: number; max_value?: number; autocomplete: true; } export interface ApplicationCommandAutocompleteStringOptionData extends Omit { type: ApplicationCommandOptionType.String; minLength?: number; min_length?: number; maxLength?: number; max_length?: number; autocomplete: true; } export interface ApplicationCommandChoicesData extends Omit { type: CommandOptionChoiceResolvableType; choices?: readonly ApplicationCommandOptionChoiceData[]; autocomplete?: false; } export interface ApplicationCommandChoicesOption extends Omit { type: CommandOptionChoiceResolvableType; choices?: readonly ApplicationCommandOptionChoiceData[]; autocomplete?: false; } export interface ApplicationCommandNumericOptionData extends ApplicationCommandChoicesData { type: CommandOptionNumericResolvableType; minValue?: number; min_value?: number; maxValue?: number; max_value?: number; } export interface ApplicationCommandStringOptionData extends ApplicationCommandChoicesData { type: ApplicationCommandOptionType.String; minLength?: number; min_length?: number; maxLength?: number; max_length?: number; } export interface ApplicationCommandBooleanOptionData extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Boolean; } export interface ApplicationCommandNumericOption extends ApplicationCommandChoicesOption { type: CommandOptionNumericResolvableType; minValue?: number; maxValue?: number; } export interface ApplicationCommandStringOption extends ApplicationCommandChoicesOption { type: ApplicationCommandOptionType.String; minLength?: number; maxLength?: number; } export interface ApplicationCommandBooleanOption extends BaseApplicationCommandOptionsData { type: ApplicationCommandOptionType.Boolean; } export interface ApplicationCommandSubGroupData extends Omit { type: ApplicationCommandOptionType.SubcommandGroup; options: readonly ApplicationCommandSubCommandData[]; } export interface ApplicationCommandSubGroup extends Omit { type: ApplicationCommandOptionType.SubcommandGroup; options?: readonly ApplicationCommandSubCommand[]; } export interface ApplicationCommandSubCommandData extends Omit { type: ApplicationCommandOptionType.Subcommand; options?: readonly Exclude< ApplicationCommandOptionData, ApplicationCommandSubGroupData | ApplicationCommandSubCommandData >[]; } export interface ApplicationCommandSubCommand extends Omit { type: ApplicationCommandOptionType.Subcommand; options?: readonly Exclude[]; } export interface ApplicationCommandNonOptionsData extends BaseApplicationCommandOptionsData { type: CommandOptionNonChoiceResolvableType; } export interface ApplicationCommandNonOptions extends BaseApplicationCommandOptionsData { type: Exclude; } export type ApplicationCommandOptionData = | ApplicationCommandSubGroupData | ApplicationCommandNonOptionsData | ApplicationCommandChannelOptionData | ApplicationCommandAutocompleteNumericOptionData | ApplicationCommandAutocompleteStringOptionData | ApplicationCommandNumericOptionData | ApplicationCommandStringOptionData | ApplicationCommandRoleOptionData | ApplicationCommandUserOptionData | ApplicationCommandMentionableOptionData | ApplicationCommandBooleanOptionData | ApplicationCommandSubCommandData; export type ApplicationCommandOption = | ApplicationCommandSubGroup | ApplicationCommandAutocompleteNumericOption | ApplicationCommandAutocompleteStringOption | ApplicationCommandNonOptions | ApplicationCommandChannelOption | ApplicationCommandNumericOption | ApplicationCommandStringOption | ApplicationCommandRoleOption | ApplicationCommandUserOption | ApplicationCommandMentionableOption | ApplicationCommandBooleanOption | ApplicationCommandAttachmentOption | ApplicationCommandSubCommand; export interface ApplicationCommandOptionChoiceData { name: string; nameLocalizations?: LocalizationMap; value: Value; } export interface ApplicationCommandPermissions { id: Snowflake; type: ApplicationCommandPermissionType; permission: boolean; } export interface ApplicationCommandPermissionsUpdateData { id: Snowflake; guildId: Snowflake; applicationId: Snowflake; permissions: readonly ApplicationCommandPermissions[]; } export interface EditApplicationCommandPermissionsMixin { permissions: readonly ApplicationCommandPermissions[]; token: string; } export type ChannelPermissionConstant = Snowflake; export type RolePermissionConstant = Snowflake; export type ApplicationCommandPermissionIdResolvable = | GuildChannelResolvable | RoleResolvable | UserResolvable | ChannelPermissionConstant | RolePermissionConstant; export type ApplicationCommandResolvable = ApplicationCommand | Snowflake; export type ApplicationFlagsString = keyof typeof ApplicationFlags; export interface ApplicationRoleConnectionMetadataEditOptions { name: string; nameLocalizations?: LocalizationMap | null; description: string; descriptionLocalizations?: LocalizationMap | null; key: string; type: ApplicationRoleConnectionMetadataType; } export interface AuditLogChange { key: APIAuditLogChange['key']; old?: APIAuditLogChange['old_value']; new?: APIAuditLogChange['new_value']; } export interface AutoModerationAction { type: AutoModerationActionType; metadata: AutoModerationActionMetadata; } export interface AutoModerationActionMetadata { channelId: Snowflake | null; durationSeconds: number | null; customMessage: string | null; } export interface AutoModerationTriggerMetadata { keywordFilter: string[]; regexPatterns: string[]; presets: AutoModerationRuleKeywordPresetType[]; allowList: string[]; mentionTotalLimit: number | null; mentionRaidProtectionEnabled: boolean; } export type AwaitMessageComponentOptions = Omit< MessageComponentCollectorOptions, 'max' | 'maxComponents' | 'maxUsers' >; export type ModalSubmitInteractionCollectorOptions = Omit< InteractionCollectorOptions, 'channel' | 'message' | 'guild' | 'interactionType' >; export type AwaitModalSubmitOptions = Omit< ModalSubmitInteractionCollectorOptions, 'max' | 'maxComponents' | 'maxUsers' > & { time: number; }; export interface AwaitMessagesOptions extends MessageCollectorOptions { errors?: string[]; } export interface AwaitReactionsOptions extends ReactionCollectorOptions { errors?: string[]; } export interface BanOptions { /** @deprecated Use {@link deleteMessageSeconds} instead. */ deleteMessageDays?: number; deleteMessageSeconds?: number; reason?: string; } export type Base64Resolvable = Buffer | Base64String; export type Base64String = string; export interface BaseFetchOptions { cache?: boolean; force?: boolean; } export type BitFieldResolvable = | RecursiveReadonlyArray>> | T | N | `${bigint}` | Readonly>; export type BufferResolvable = Buffer | string; export interface Caches { AutoModerationRuleManager: [manager: typeof AutoModerationRuleManager, holds: typeof AutoModerationRule]; ApplicationCommandManager: [manager: typeof ApplicationCommandManager, holds: typeof ApplicationCommand]; BaseGuildEmojiManager: [manager: typeof BaseGuildEmojiManager, holds: typeof GuildEmoji]; DMMessageManager: [manager: typeof MessageManager, holds: typeof Message]; GuildEmojiManager: [manager: typeof GuildEmojiManager, holds: typeof GuildEmoji]; // TODO: ChannelManager: [manager: typeof ChannelManager, holds: typeof Channel]; // TODO: GuildChannelManager: [manager: typeof GuildChannelManager, holds: typeof GuildChannel]; // TODO: GuildManager: [manager: typeof GuildManager, holds: typeof Guild]; GuildMemberManager: [manager: typeof GuildMemberManager, holds: typeof GuildMember]; GuildBanManager: [manager: typeof GuildBanManager, holds: typeof GuildBan]; GuildForumThreadManager: [manager: typeof GuildForumThreadManager, holds: typeof ThreadChannel]; GuildInviteManager: [manager: typeof GuildInviteManager, holds: typeof Invite]; GuildMessageManager: [manager: typeof GuildMessageManager, holds: typeof Message]; GuildScheduledEventManager: [manager: typeof GuildScheduledEventManager, holds: typeof GuildScheduledEvent]; GuildStickerManager: [manager: typeof GuildStickerManager, holds: typeof Sticker]; GuildTextThreadManager: [manager: typeof GuildTextThreadManager, holds: typeof ThreadChannel]; MessageManager: [manager: typeof MessageManager, holds: typeof Message]; // TODO: PermissionOverwriteManager: [manager: typeof PermissionOverwriteManager, holds: typeof PermissionOverwrites]; PresenceManager: [manager: typeof PresenceManager, holds: typeof Presence]; ReactionManager: [manager: typeof ReactionManager, holds: typeof MessageReaction]; ReactionUserManager: [manager: typeof ReactionUserManager, holds: typeof User]; // TODO: RoleManager: [manager: typeof RoleManager, holds: typeof Role]; StageInstanceManager: [manager: typeof StageInstanceManager, holds: typeof StageInstance]; ThreadManager: [manager: typeof ThreadManager, holds: typeof ThreadChannel]; ThreadMemberManager: [manager: typeof ThreadMemberManager, holds: typeof ThreadMember]; UserManager: [manager: typeof UserManager, holds: typeof User]; VoiceStateManager: [manager: typeof VoiceStateManager, holds: typeof VoiceState]; } export type CacheConstructors = { [K in keyof Caches]: Caches[K][0] & { name: K }; }; type OverriddenCaches = | 'DMMessageManager' | 'GuildForumThreadManager' | 'GuildMessageManager' | 'GuildTextThreadManager'; // This doesn't actually work the way it looks 😢. // Narrowing the type of `manager.name` doesn't propagate type information to `holds` and the return type. export type CacheFactory = ( managerType: CacheConstructors[Exclude], holds: Caches[(typeof manager)['name']][1], manager: CacheConstructors[keyof Caches], ) => (typeof manager)['prototype'] extends DataManager ? Collection : never; export type CacheWithLimitsOptions = { [K in keyof Caches]?: Caches[K][0]['prototype'] extends DataManager ? LimitedCollectionOptions | number : never; }; export interface CategoryCreateChannelOptions { name: string; permissionOverwrites?: OverwriteResolvable[] | Collection; topic?: string; type?: CategoryChannelType; nsfw?: boolean; bitrate?: number; userLimit?: number; rateLimitPerUser?: number; position?: number; rtcRegion?: string; videoQualityMode?: VideoQualityMode; availableTags?: GuildForumTagData[]; defaultReactionEmoji?: DefaultReactionEmoji; defaultAutoArchiveDuration?: ThreadAutoArchiveDuration; defaultSortOrder?: SortOrderType; defaultForumLayout?: ForumLayoutType; reason?: string; } export interface ChannelCreationOverwrites { allow?: PermissionResolvable; deny?: PermissionResolvable; id: RoleResolvable | UserResolvable; } export type ChannelMention = `<#${Snowflake}>`; export interface ChannelPosition { channel: NonThreadGuildBasedChannel | Snowflake; lockPermissions?: boolean; parent?: CategoryChannelResolvable | null; position?: number; } export type GuildTextChannelResolvable = TextChannel | NewsChannel | Snowflake; export type ChannelResolvable = Channel | Snowflake; export interface ChannelWebhookCreateOptions { name: string; avatar?: BufferResolvable | Base64Resolvable | null; reason?: string; } export interface WebhookCreateOptions extends ChannelWebhookCreateOptions { channel: TextChannel | NewsChannel | VoiceChannel | StageChannel | ForumChannel | Snowflake; } export interface ClientEvents { applicationCommandPermissionsUpdate: [data: ApplicationCommandPermissionsUpdateData]; autoModerationActionExecution: [autoModerationActionExecution: AutoModerationActionExecution]; autoModerationRuleCreate: [autoModerationRule: AutoModerationRule]; autoModerationRuleDelete: [autoModerationRule: AutoModerationRule]; autoModerationRuleUpdate: [ oldAutoModerationRule: AutoModerationRule | null, newAutoModerationRule: AutoModerationRule, ]; cacheSweep: [message: string]; channelCreate: [channel: NonThreadGuildBasedChannel]; channelDelete: [channel: DMChannel | NonThreadGuildBasedChannel]; channelPinsUpdate: [channel: TextBasedChannel, date: Date]; channelUpdate: [ oldChannel: DMChannel | NonThreadGuildBasedChannel, newChannel: DMChannel | NonThreadGuildBasedChannel, ]; debug: [message: string]; warn: [message: string]; emojiCreate: [emoji: GuildEmoji]; emojiDelete: [emoji: GuildEmoji]; emojiUpdate: [oldEmoji: GuildEmoji, newEmoji: GuildEmoji]; error: [error: Error]; guildAuditLogEntryCreate: [auditLogEntry: GuildAuditLogsEntry, guild: Guild]; guildAvailable: [guild: Guild]; guildBanAdd: [ban: GuildBan]; guildBanRemove: [ban: GuildBan]; guildCreate: [guild: Guild]; guildDelete: [guild: Guild]; guildUnavailable: [guild: Guild]; guildIntegrationsUpdate: [guild: Guild]; guildMemberAdd: [member: GuildMember]; guildMemberAvailable: [member: GuildMember | PartialGuildMember]; guildMemberRemove: [member: GuildMember | PartialGuildMember]; guildMembersChunk: [ members: Collection, guild: Guild, data: { index: number; count: number; notFound: unknown[]; nonce: string | undefined }, ]; guildMemberUpdate: [oldMember: GuildMember | PartialGuildMember, newMember: GuildMember]; guildUpdate: [oldGuild: Guild, newGuild: Guild]; inviteCreate: [invite: Invite]; inviteDelete: [invite: Invite]; messageCreate: [message: Message]; messageDelete: [message: Message | PartialMessage]; messageReactionRemoveAll: [ message: Message | PartialMessage, reactions: Collection, ]; messageReactionRemoveEmoji: [reaction: MessageReaction | PartialMessageReaction]; messageDeleteBulk: [messages: Collection, channel: GuildTextBasedChannel]; messageReactionAdd: [reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser]; messageReactionRemove: [reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser]; messageUpdate: [oldMessage: Message | PartialMessage, newMessage: Message | PartialMessage]; presenceUpdate: [oldPresence: Presence | null, newPresence: Presence]; ready: [client: Client]; invalidated: []; roleCreate: [role: Role]; roleDelete: [role: Role]; roleUpdate: [oldRole: Role, newRole: Role]; threadCreate: [thread: AnyThreadChannel, newlyCreated: boolean]; threadDelete: [thread: AnyThreadChannel]; threadListSync: [threads: Collection, guild: Guild]; threadMemberUpdate: [oldMember: ThreadMember, newMember: ThreadMember]; threadMembersUpdate: [ addedMembers: Collection, removedMembers: Collection, thread: AnyThreadChannel, ]; threadUpdate: [oldThread: AnyThreadChannel, newThread: AnyThreadChannel]; typingStart: [typing: Typing]; userUpdate: [oldUser: User | PartialUser, newUser: User]; voiceStateUpdate: [oldState: VoiceState, newState: VoiceState]; /** @deprecated Use {@link webhooksUpdate} instead. */ webhookUpdate: ClientEvents['webhooksUpdate']; webhooksUpdate: [channel: TextChannel | NewsChannel | VoiceChannel | ForumChannel]; interactionCreate: [interaction: Interaction]; shardDisconnect: [closeEvent: CloseEvent, shardId: number]; shardError: [error: Error, shardId: number]; shardReady: [shardId: number, unavailableGuilds: Set | undefined]; shardReconnecting: [shardId: number]; shardResume: [shardId: number, replayedEvents: number]; stageInstanceCreate: [stageInstance: StageInstance]; stageInstanceUpdate: [oldStageInstance: StageInstance | null, newStageInstance: StageInstance]; stageInstanceDelete: [stageInstance: StageInstance]; stickerCreate: [sticker: Sticker]; stickerDelete: [sticker: Sticker]; stickerUpdate: [oldSticker: Sticker, newSticker: Sticker]; guildScheduledEventCreate: [guildScheduledEvent: GuildScheduledEvent]; guildScheduledEventUpdate: [ oldGuildScheduledEvent: GuildScheduledEvent | null, newGuildScheduledEvent: GuildScheduledEvent, ]; guildScheduledEventDelete: [guildScheduledEvent: GuildScheduledEvent]; guildScheduledEventUserAdd: [guildScheduledEvent: GuildScheduledEvent, user: User]; guildScheduledEventUserRemove: [guildScheduledEvent: GuildScheduledEvent, user: User]; } export interface ClientFetchInviteOptions { guildScheduledEventId?: Snowflake; } export interface ClientOptions { shards?: number | number[] | 'auto'; shardCount?: number; closeTimeout?: number; makeCache?: CacheFactory; allowedMentions?: MessageMentionOptions; partials?: Partials[]; failIfNotExists?: boolean; presence?: PresenceData; intents: BitFieldResolvable; waitGuildTimeout?: number; sweepers?: SweeperOptions; ws?: WebSocketOptions; rest?: Partial; jsonTransformer?: (obj: unknown) => unknown; } export type ClientPresenceStatus = 'online' | 'idle' | 'dnd'; export interface ClientPresenceStatusData { web?: ClientPresenceStatus; mobile?: ClientPresenceStatus; desktop?: ClientPresenceStatus; } export interface ClientUserEditOptions { username?: string; avatar?: BufferResolvable | Base64Resolvable | null; } export interface CloseEvent { /** @deprecated */ wasClean: boolean; code: number; /** @deprecated */ reason: string; } export type CollectorFilter = (...args: T) => boolean | Promise; export interface CollectorOptions { filter?: CollectorFilter; time?: number; idle?: number; dispose?: boolean; } export interface CollectorResetTimerOptions { time?: number; idle?: number; } export type ColorResolvable = | keyof typeof Colors | 'Random' | readonly [red: number, green: number, blue: number] | number | HexColorString; export interface CommandInteractionOption { name: string; type: ApplicationCommandOptionType; value?: string | number | boolean; focused?: boolean; autocomplete?: boolean; options?: CommandInteractionOption[]; user?: User; member?: CacheTypeReducer; channel?: CacheTypeReducer; role?: CacheTypeReducer; attachment?: Attachment; message?: Message>; } export interface CommandInteractionResolvedData { users?: Collection; members?: Collection>; roles?: Collection>; channels?: Collection>; messages?: Collection>; attachments?: Collection; } export type AutocompleteFocusedOption = Pick & { focused: true; type: | ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; value: string; }; export declare const Colors: { Default: 0x000000; White: 0xffffff; Aqua: 0x1abc9c; Green: 0x57f287; Blue: 0x3498db; Yellow: 0xfee75c; Purple: 0x9b59b6; LuminousVividPink: 0xe91e63; Fuchsia: 0xeb459e; Gold: 0xf1c40f; Orange: 0xe67e22; Red: 0xed4245; Grey: 0x95a5a6; Navy: 0x34495e; DarkAqua: 0x11806a; DarkGreen: 0x1f8b4c; DarkBlue: 0x206694; DarkPurple: 0x71368a; DarkVividPink: 0xad1457; DarkGold: 0xc27c0e; DarkOrange: 0xa84300; DarkRed: 0x992d22; DarkGrey: 0x979c9f; DarkerGrey: 0x7f8c8d; LightGrey: 0xbcc0c0; DarkNavy: 0x2c3e50; Blurple: 0x5865f2; Greyple: 0x99aab5; DarkButNotBlack: 0x2c2f33; NotQuiteBlack: 0x23272a; }; export enum Events { ApplicationCommandPermissionsUpdate = 'applicationCommandPermissionsUpdate', AutoModerationActionExecution = 'autoModerationActionExecution', AutoModerationRuleCreate = 'autoModerationRuleCreate', AutoModerationRuleDelete = 'autoModerationRuleDelete', AutoModerationRuleUpdate = 'autoModerationRuleUpdate', ClientReady = 'ready', GuildAuditLogEntryCreate = 'guildAuditLogEntryCreate', GuildAvailable = 'guildAvailable', GuildCreate = 'guildCreate', GuildDelete = 'guildDelete', GuildUpdate = 'guildUpdate', GuildUnavailable = 'guildUnavailable', GuildMemberAdd = 'guildMemberAdd', GuildMemberRemove = 'guildMemberRemove', GuildMemberUpdate = 'guildMemberUpdate', GuildMemberAvailable = 'guildMemberAvailable', GuildMembersChunk = 'guildMembersChunk', GuildIntegrationsUpdate = 'guildIntegrationsUpdate', GuildRoleCreate = 'roleCreate', GuildRoleDelete = 'roleDelete', InviteCreate = 'inviteCreate', InviteDelete = 'inviteDelete', GuildRoleUpdate = 'roleUpdate', GuildEmojiCreate = 'emojiCreate', GuildEmojiDelete = 'emojiDelete', GuildEmojiUpdate = 'emojiUpdate', GuildBanAdd = 'guildBanAdd', GuildBanRemove = 'guildBanRemove', ChannelCreate = 'channelCreate', ChannelDelete = 'channelDelete', ChannelUpdate = 'channelUpdate', ChannelPinsUpdate = 'channelPinsUpdate', MessageCreate = 'messageCreate', MessageDelete = 'messageDelete', MessageUpdate = 'messageUpdate', MessageBulkDelete = 'messageDeleteBulk', MessageReactionAdd = 'messageReactionAdd', MessageReactionRemove = 'messageReactionRemove', MessageReactionRemoveAll = 'messageReactionRemoveAll', MessageReactionRemoveEmoji = 'messageReactionRemoveEmoji', ThreadCreate = 'threadCreate', ThreadDelete = 'threadDelete', ThreadUpdate = 'threadUpdate', ThreadListSync = 'threadListSync', ThreadMemberUpdate = 'threadMemberUpdate', ThreadMembersUpdate = 'threadMembersUpdate', UserUpdate = 'userUpdate', PresenceUpdate = 'presenceUpdate', VoiceServerUpdate = 'voiceServerUpdate', VoiceStateUpdate = 'voiceStateUpdate', TypingStart = 'typingStart', WebhooksUpdate = 'webhookUpdate', InteractionCreate = 'interactionCreate', Error = 'error', Warn = 'warn', Debug = 'debug', CacheSweep = 'cacheSweep', ShardDisconnect = 'shardDisconnect', ShardError = 'shardError', ShardReconnecting = 'shardReconnecting', ShardReady = 'shardReady', ShardResume = 'shardResume', Invalidated = 'invalidated', Raw = 'raw', StageInstanceCreate = 'stageInstanceCreate', StageInstanceUpdate = 'stageInstanceUpdate', StageInstanceDelete = 'stageInstanceDelete', GuildStickerCreate = 'stickerCreate', GuildStickerDelete = 'stickerDelete', GuildStickerUpdate = 'stickerUpdate', GuildScheduledEventCreate = 'guildScheduledEventCreate', GuildScheduledEventUpdate = 'guildScheduledEventUpdate', GuildScheduledEventDelete = 'guildScheduledEventDelete', GuildScheduledEventUserAdd = 'guildScheduledEventUserAdd', GuildScheduledEventUserRemove = 'guildScheduledEventUserRemove', } export enum ShardEvents { Death = 'death', Disconnect = 'disconnect', Error = 'error', Message = 'message', Ready = 'ready', Reconnecting = 'reconnecting', Resume = 'resume', Spawn = 'spawn', } export enum WebSocketShardEvents { Close = 'close', Destroyed = 'destroyed', InvalidSession = 'invalidSession', Ready = 'ready', Resumed = 'resumed', AllReady = 'allReady', } export enum Status { Ready = 0, Connecting = 1, Reconnecting = 2, Idle = 3, Nearly = 4, Disconnected = 5, WaitingForGuilds = 6, Identifying = 7, Resuming = 8, } export interface GuildScheduledEventInviteURLCreateOptions extends InviteCreateOptions { channel?: GuildInvitableChannelResolvable; } export interface RoleCreateOptions extends RoleData { reason?: string; } export interface RoleEditOptions extends RoleData { reason?: string; } export interface StageInstanceCreateOptions { topic: string; privacyLevel?: StageInstancePrivacyLevel; sendStartNotification?: boolean; } export interface CrosspostedChannel { channelId: Snowflake; guildId: Snowflake; type: ChannelType; name: string; } export type DateResolvable = Date | number | string; export interface GuildTemplateEditOptions { name?: string; description?: string; } export interface EmbedField { name: string; value: string; inline: boolean; } export type EmojiIdentifierResolvable = | EmojiResolvable | `${'' | 'a:'}${string}:${Snowflake}` | `<${'' | 'a'}:${string}:${Snowflake}>` | string; export type EmojiResolvable = Snowflake | GuildEmoji | ReactionEmoji; export interface ErrorEvent { error: unknown; message: string; type: string; target: WebSocket; } export interface FetchApplicationCommandOptions extends BaseFetchOptions { guildId?: Snowflake; locale?: LocaleString; withLocalizations?: boolean; } export interface FetchArchivedThreadOptions { type?: 'public' | 'private'; fetchAll?: boolean; before?: ThreadChannelResolvable | DateResolvable; limit?: number; } export interface FetchAutoModerationRuleOptions extends BaseFetchOptions { autoModerationRule: AutoModerationRuleResolvable; } export interface FetchAutoModerationRulesOptions { cache?: boolean; } export interface FetchBanOptions extends BaseFetchOptions { user: UserResolvable; } export interface FetchBansOptions { limit?: number; before?: Snowflake; after?: Snowflake; cache?: boolean; } export interface FetchChannelOptions extends BaseFetchOptions { allowUnknownGuild?: boolean; } export interface FetchedThreads { threads: Collection; members: Collection; } export interface FetchedThreadsMore extends FetchedThreads { hasMore: boolean; } export interface FetchGuildOptions extends BaseFetchOptions { guild: GuildResolvable; withCounts?: boolean; } export interface FetchGuildsOptions { before?: Snowflake; after?: Snowflake; limit?: number; } export interface FetchGuildScheduledEventOptions extends BaseFetchOptions { guildScheduledEvent: GuildScheduledEventResolvable; withUserCount?: boolean; } export interface FetchGuildScheduledEventsOptions { cache?: boolean; withUserCount?: boolean; } export interface FetchGuildScheduledEventSubscribersOptions { limit?: number; withMember?: boolean; } interface FetchInviteOptions extends BaseFetchOptions { code: string; } interface FetchInvitesOptions { channelId?: GuildInvitableChannelResolvable; cache?: boolean; } export interface FetchMemberOptions extends BaseFetchOptions { user: UserResolvable; } export interface FetchMembersOptions { user?: UserResolvable | UserResolvable[]; query?: string; limit?: number; withPresences?: boolean; time?: number; nonce?: string; } export interface FetchMessageOptions extends BaseFetchOptions { message: MessageResolvable; } export interface FetchMessagesOptions { limit?: number; before?: Snowflake; after?: Snowflake; around?: Snowflake; cache?: boolean; } export interface FetchReactionUsersOptions { limit?: number; after?: Snowflake; } export interface FetchThreadMemberOptions extends BaseFetchOptions { member: ThreadMemberResolvable; withMember?: boolean; } export interface FetchThreadMembersWithGuildMemberDataOptions { withMember: true; after?: Snowflake; limit?: number; cache?: boolean; } export interface FetchThreadMembersWithoutGuildMemberDataOptions { withMember?: false; cache?: boolean; } export type FetchThreadMembersOptions = | FetchThreadMembersWithGuildMemberDataOptions | FetchThreadMembersWithoutGuildMemberDataOptions; export interface FetchThreadsOptions { archived?: FetchArchivedThreadOptions; } export interface AttachmentPayload { attachment: BufferResolvable | Stream; name?: string; description?: string; } export type GlobalSweepFilter = () => ((value: V, key: K, collection: Collection) => boolean) | null; interface GuildAuditLogsTypes { [AuditLogEvent.GuildUpdate]: ['Guild', 'Update']; [AuditLogEvent.ChannelCreate]: ['Channel', 'Create']; [AuditLogEvent.ChannelUpdate]: ['Channel', 'Update']; [AuditLogEvent.ChannelDelete]: ['Channel', 'Delete']; [AuditLogEvent.ChannelOverwriteCreate]: ['Channel', 'Create']; [AuditLogEvent.ChannelOverwriteUpdate]: ['Channel', 'Update']; [AuditLogEvent.ChannelOverwriteDelete]: ['Channel', 'Delete']; [AuditLogEvent.MemberKick]: ['User', 'Delete']; [AuditLogEvent.MemberPrune]: ['User', 'Delete']; [AuditLogEvent.MemberBanAdd]: ['User', 'Delete']; [AuditLogEvent.MemberBanRemove]: ['User', 'Create']; [AuditLogEvent.MemberUpdate]: ['User', 'Update']; [AuditLogEvent.MemberRoleUpdate]: ['User', 'Update']; [AuditLogEvent.MemberMove]: ['User', 'Update']; [AuditLogEvent.MemberDisconnect]: ['User', 'Delete']; [AuditLogEvent.BotAdd]: ['User', 'Create']; [AuditLogEvent.RoleCreate]: ['Role', 'Create']; [AuditLogEvent.RoleUpdate]: ['Role', 'Update']; [AuditLogEvent.RoleDelete]: ['Role', 'Delete']; [AuditLogEvent.InviteCreate]: ['Invite', 'Create']; [AuditLogEvent.InviteUpdate]: ['Invite', 'Update']; [AuditLogEvent.InviteDelete]: ['Invite', 'Delete']; [AuditLogEvent.WebhookCreate]: ['Webhook', 'Create']; [AuditLogEvent.WebhookUpdate]: ['Webhook', 'Update']; [AuditLogEvent.WebhookDelete]: ['Webhook', 'Delete']; [AuditLogEvent.EmojiCreate]: ['Emoji', 'Create']; [AuditLogEvent.EmojiUpdate]: ['Emoji', 'Update']; [AuditLogEvent.EmojiDelete]: ['Emoji', 'Delete']; [AuditLogEvent.MessageDelete]: ['Message', 'Delete']; [AuditLogEvent.MessageBulkDelete]: ['Message', 'Delete']; [AuditLogEvent.MessagePin]: ['Message', 'Create']; [AuditLogEvent.MessageUnpin]: ['Message', 'Delete']; [AuditLogEvent.IntegrationCreate]: ['Integration', 'Create']; [AuditLogEvent.IntegrationUpdate]: ['Integration', 'Update']; [AuditLogEvent.IntegrationDelete]: ['Integration', 'Delete']; [AuditLogEvent.StageInstanceCreate]: ['StageInstance', 'Create']; [AuditLogEvent.StageInstanceUpdate]: ['StageInstance', 'Update']; [AuditLogEvent.StageInstanceDelete]: ['StageInstance', 'Delete']; [AuditLogEvent.StickerCreate]: ['Sticker', 'Create']; [AuditLogEvent.StickerUpdate]: ['Sticker', 'Update']; [AuditLogEvent.StickerDelete]: ['Sticker', 'Delete']; [AuditLogEvent.GuildScheduledEventCreate]: ['GuildScheduledEvent', 'Create']; [AuditLogEvent.GuildScheduledEventUpdate]: ['GuildScheduledEvent', 'Update']; [AuditLogEvent.GuildScheduledEventDelete]: ['GuildScheduledEvent', 'Delete']; [AuditLogEvent.ThreadCreate]: ['Thread', 'Create']; [AuditLogEvent.ThreadUpdate]: ['Thread', 'Update']; [AuditLogEvent.ThreadDelete]: ['Thread', 'Delete']; [AuditLogEvent.ApplicationCommandPermissionUpdate]: ['ApplicationCommand', 'Update']; [AuditLogEvent.AutoModerationRuleCreate]: ['AutoModerationRule', 'Create']; [AuditLogEvent.AutoModerationRuleUpdate]: ['AutoModerationRule', 'Update']; [AuditLogEvent.AutoModerationRuleDelete]: ['AutoModerationRule', 'Delete']; [AuditLogEvent.AutoModerationBlockMessage]: ['AutoModerationRule', 'Create']; [AuditLogEvent.AutoModerationFlagToChannel]: ['AutoModerationRule', 'Create']; [AuditLogEvent.AutoModerationUserCommunicationDisabled]: ['AutoModerationRule', 'Create']; } export type GuildAuditLogsActionType = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][1] | 'All'; export interface GuildAuditLogsEntryExtraField { [AuditLogEvent.MemberPrune]: { removed: number; days: number }; [AuditLogEvent.MemberMove]: { channel: VoiceBasedChannel | { id: Snowflake }; count: number }; [AuditLogEvent.MessageDelete]: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number }; [AuditLogEvent.MessageBulkDelete]: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number }; [AuditLogEvent.MessagePin]: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake }; [AuditLogEvent.MessageUnpin]: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake }; [AuditLogEvent.MemberDisconnect]: { count: number }; [AuditLogEvent.ChannelOverwriteCreate]: | Role | GuildMember | { id: Snowflake; name: string; type: AuditLogOptionsType.Role } | { id: Snowflake; type: AuditLogOptionsType.Member }; [AuditLogEvent.ChannelOverwriteUpdate]: | Role | GuildMember | { id: Snowflake; name: string; type: AuditLogOptionsType.Role } | { id: Snowflake; type: AuditLogOptionsType.Member }; [AuditLogEvent.ChannelOverwriteDelete]: | Role | GuildMember | { id: Snowflake; name: string; type: AuditLogOptionsType.Role } | { id: Snowflake; type: AuditLogOptionsType.Member }; [AuditLogEvent.StageInstanceCreate]: StageChannel | { id: Snowflake }; [AuditLogEvent.StageInstanceDelete]: StageChannel | { id: Snowflake }; [AuditLogEvent.StageInstanceUpdate]: StageChannel | { id: Snowflake }; [AuditLogEvent.ApplicationCommandPermissionUpdate]: { applicationId: Snowflake }; [AuditLogEvent.AutoModerationBlockMessage]: { autoModerationRuleName: string; autoModerationRuleTriggerType: AuditLogRuleTriggerType; channel: GuildTextBasedChannel | { id: Snowflake }; }; [AuditLogEvent.AutoModerationFlagToChannel]: { autoModerationRuleName: string; autoModerationRuleTriggerType: AuditLogRuleTriggerType; channel: GuildTextBasedChannel | { id: Snowflake }; }; [AuditLogEvent.AutoModerationUserCommunicationDisabled]: { autoModerationRuleName: string; autoModerationRuleTriggerType: AuditLogRuleTriggerType; channel: GuildTextBasedChannel | { id: Snowflake }; }; } export interface GuildAuditLogsEntryTargetField { User: User | null; Guild: Guild; Webhook: Webhook; Invite: Invite; Message: TActionType extends AuditLogEvent.MessageBulkDelete ? Guild | { id: Snowflake } : User; Integration: Integration; Channel: NonThreadGuildBasedChannel | { id: Snowflake; [x: string]: unknown }; Thread: AnyThreadChannel | { id: Snowflake; [x: string]: unknown }; StageInstance: StageInstance; Sticker: Sticker; GuildScheduledEvent: GuildScheduledEvent; ApplicationCommand: ApplicationCommand | { id: Snowflake }; AutoModerationRule: AutoModerationRule; } export interface GuildAuditLogsFetchOptions { before?: Snowflake | GuildAuditLogsEntry; after?: Snowflake | GuildAuditLogsEntry; limit?: number; user?: UserResolvable; type?: T; } export type GuildAuditLogsResolvable = AuditLogEvent | null; export type GuildAuditLogsTargetType = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][0] | 'All' | 'Unknown'; export type GuildAuditLogsTargets = { [key in GuildAuditLogsTargetType]: GuildAuditLogsTargetType; }; export type GuildBanResolvable = GuildBan | UserResolvable; export type GuildChannelResolvable = Snowflake | GuildBasedChannel; export interface AutoModerationRuleCreateOptions { name: string; eventType: AutoModerationRuleEventType; triggerType: AutoModerationRuleTriggerType; triggerMetadata?: AutoModerationTriggerMetadataOptions; actions: AutoModerationActionOptions[]; enabled?: boolean; exemptRoles?: Collection | RoleResolvable[]; exemptChannels?: Collection | GuildChannelResolvable[]; reason?: string; } export interface AutoModerationRuleEditOptions extends Partial> {} export interface AutoModerationTriggerMetadataOptions extends Partial {} export interface AutoModerationActionOptions { type: AutoModerationActionType; metadata?: AutoModerationActionMetadataOptions; } export interface AutoModerationActionMetadataOptions extends Partial> { channel?: GuildTextChannelResolvable | ThreadChannel; } export interface GuildChannelCreateOptions extends Omit { parent?: CategoryChannelResolvable | null; type?: Exclude< ChannelType, | ChannelType.DM | ChannelType.GroupDM | ChannelType.PublicThread | ChannelType.AnnouncementThread | ChannelType.PrivateThread >; } export interface GuildChannelCloneOptions extends Omit { name?: string; } export interface GuildChannelEditOptions { name?: string; type?: ChannelType.GuildText | ChannelType.GuildAnnouncement; position?: number; topic?: string | null; nsfw?: boolean; bitrate?: number; userLimit?: number; parent?: CategoryChannelResolvable | null; rateLimitPerUser?: number; lockPermissions?: boolean; permissionOverwrites?: readonly OverwriteResolvable[] | Collection; defaultAutoArchiveDuration?: ThreadAutoArchiveDuration; rtcRegion?: string | null; videoQualityMode?: VideoQualityMode | null; availableTags?: GuildForumTagData[]; defaultReactionEmoji?: DefaultReactionEmoji | null; defaultThreadRateLimitPerUser?: number; flags?: ChannelFlagsResolvable; defaultSortOrder?: SortOrderType | null; defaultForumLayout?: ForumLayoutType; reason?: string; } export interface GuildChannelOverwriteOptions { reason?: string; type?: OverwriteType; } export interface GuildCreateOptions { name: string; icon?: BufferResolvable | Base64Resolvable | null; verificationLevel?: GuildVerificationLevel; defaultMessageNotifications?: GuildDefaultMessageNotifications; explicitContentFilter?: GuildExplicitContentFilter; roles?: PartialRoleData[]; channels?: PartialChannelData[]; afkChannelId?: Snowflake | number; afkTimeout?: number; systemChannelId?: Snowflake | number; systemChannelFlags?: SystemChannelFlagsResolvable; } export interface GuildWidgetSettings { enabled: boolean; channel: TextChannel | NewsChannel | VoiceBasedChannel | ForumChannel | null; } export interface GuildEditOptions { name?: string; verificationLevel?: GuildVerificationLevel | null; defaultMessageNotifications?: GuildDefaultMessageNotifications | null; explicitContentFilter?: GuildExplicitContentFilter | null; afkTimeout?: number; afkChannel?: VoiceChannelResolvable | null; icon?: BufferResolvable | Base64Resolvable | null; owner?: GuildMemberResolvable; splash?: BufferResolvable | Base64Resolvable | null; discoverySplash?: BufferResolvable | Base64Resolvable | null; banner?: BufferResolvable | Base64Resolvable | null; systemChannel?: TextChannelResolvable | null; systemChannelFlags?: SystemChannelFlagsResolvable; rulesChannel?: TextChannelResolvable | null; publicUpdatesChannel?: TextChannelResolvable | null; safetyAlertsChannel?: TextChannelResolvable | null; preferredLocale?: Locale | null; features?: `${GuildFeature}`[]; description?: string | null; premiumProgressBarEnabled?: boolean; reason?: string; } export interface GuildEmojiCreateOptions { attachment: BufferResolvable | Base64Resolvable; name: string; roles?: Collection | RoleResolvable[]; reason?: string; } export interface GuildEmojiEditOptions { name?: string; roles?: Collection | RoleResolvable[]; reason?: string; } export interface GuildStickerCreateOptions { file: BufferResolvable | Stream | AttachmentPayload | JSONEncodable; name: string; tags: string; description?: string | null; reason?: string; } export interface GuildStickerEditOptions { name?: string; description?: string | null; tags?: string; reason?: string; } export interface GuildMemberEditOptions { nick?: string | null; roles?: Collection | readonly RoleResolvable[]; mute?: boolean; deaf?: boolean; channel?: GuildVoiceChannelResolvable | null; communicationDisabledUntil?: DateResolvable | null; flags?: GuildMemberFlagsResolvable; reason?: string; } export type GuildMemberResolvable = GuildMember | UserResolvable; export type GuildResolvable = Guild | NonThreadGuildBasedChannel | GuildMember | GuildEmoji | Invite | Role | Snowflake; export interface GuildPruneMembersOptions { count?: boolean; days?: number; dry?: boolean; reason?: string; roles?: RoleResolvable[]; } export interface GuildWidgetSettingsData { enabled: boolean; channel: TextChannel | NewsChannel | VoiceBasedChannel | ForumChannel | Snowflake | null; } export interface GuildSearchMembersOptions { query: string; limit?: number; cache?: boolean; } export interface GuildListMembersOptions { after?: Snowflake; limit?: number; cache?: boolean; } // TODO: use conditional types for better TS support export interface GuildScheduledEventCreateOptions { name: string; scheduledStartTime: DateResolvable; scheduledEndTime?: DateResolvable; privacyLevel: GuildScheduledEventPrivacyLevel; entityType: GuildScheduledEventEntityType; description?: string; channel?: GuildVoiceChannelResolvable; entityMetadata?: GuildScheduledEventEntityMetadataOptions; image?: BufferResolvable | Base64Resolvable | null; reason?: string; } export interface GuildScheduledEventEditOptions< S extends GuildScheduledEventStatus, T extends GuildScheduledEventSetStatusArg, > extends Omit, 'channel'> { channel?: GuildVoiceChannelResolvable | null; status?: T; } export interface GuildScheduledEventEntityMetadata { location: string | null; } export interface GuildScheduledEventEntityMetadataOptions { location?: string; } export type GuildScheduledEventManagerFetchResult< T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions | FetchGuildScheduledEventsOptions, > = T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions ? GuildScheduledEvent : Collection; export type GuildScheduledEventManagerFetchSubscribersResult = T extends { withMember: true } ? Collection> : Collection>; export type GuildScheduledEventResolvable = Snowflake | GuildScheduledEvent; export type GuildScheduledEventSetStatusArg = T extends GuildScheduledEventStatus.Scheduled ? GuildScheduledEventStatus.Active | GuildScheduledEventStatus.Canceled : T extends GuildScheduledEventStatus.Active ? GuildScheduledEventStatus.Completed : never; export interface GuildScheduledEventUser { guildScheduledEventId: Snowflake; user: User; member: T extends true ? GuildMember : null; } export type GuildTemplateResolvable = string; export type GuildVoiceChannelResolvable = VoiceBasedChannel | Snowflake; export interface GuildOnboardingPromptOptionEmoji { id: Snowflake | null; name: string; animated: boolean; } export type HexColorString = `#${string}`; export interface IntegrationAccount { id: string | Snowflake; name: string; } export type IntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription'; export type CollectedInteraction = | StringSelectMenuInteraction | UserSelectMenuInteraction | RoleSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction | ButtonInteraction | ModalSubmitInteraction; export interface InteractionCollectorOptions extends CollectorOptions<[T, Collection]> { channel?: TextBasedChannelResolvable; componentType?: ComponentType; guild?: GuildResolvable; interactionType?: InteractionType; max?: number; maxComponents?: number; maxUsers?: number; message?: CacheTypeReducer; interactionResponse?: InteractionResponse>; } export interface InteractionDeferReplyOptions { ephemeral?: boolean; fetchReply?: boolean; } export type InteractionDeferUpdateOptions = Omit; export interface InteractionReplyOptions extends BaseMessageOptions { tts?: boolean; ephemeral?: boolean; fetchReply?: boolean; flags?: BitFieldResolvable< Extract, MessageFlags.Ephemeral | MessageFlags.SuppressEmbeds >; } export interface InteractionUpdateOptions extends MessageEditOptions { fetchReply?: boolean; } export interface InviteGenerationOptions { permissions?: PermissionResolvable; guild?: GuildResolvable; disableGuildSelect?: boolean; scopes: OAuth2Scopes[]; } export type GuildInvitableChannelResolvable = | TextChannel | VoiceChannel | NewsChannel | StageChannel | ForumChannel | Snowflake; export interface InviteCreateOptions { temporary?: boolean; maxAge?: number; maxUses?: number; unique?: boolean; reason?: string; targetApplication?: ApplicationResolvable; targetUser?: UserResolvable; targetType?: InviteTargetType; } export type InviteResolvable = string; export interface LifetimeFilterOptions { excludeFromSweep?: (value: V, key: K, collection: LimitedCollection) => boolean; getComparisonTimestamp?: (value: V, key: K, collection: LimitedCollection) => number; lifetime?: number; } export interface MakeErrorOptions { name: string; message: string; stack: string; } export type ActionRowComponentOptions = | ButtonComponentData | StringSelectMenuComponentData | UserSelectMenuComponentData | RoleSelectMenuComponentData | MentionableSelectMenuComponentData | ChannelSelectMenuComponentData; export type MessageActionRowComponentResolvable = MessageActionRowComponent | ActionRowComponentOptions; export interface MessageActivity { partyId?: string; type: MessageActivityType; } export interface BaseButtonComponentData extends BaseComponentData { type: ComponentType.Button; style: ButtonStyle; disabled?: boolean; emoji?: ComponentEmojiResolvable; label?: string; } export interface LinkButtonComponentData extends BaseButtonComponentData { style: ButtonStyle.Link; url: string; } export interface InteractionButtonComponentData extends BaseButtonComponentData { style: Exclude; customId: string; } export type ButtonComponentData = InteractionButtonComponentData | LinkButtonComponentData; export interface MessageCollectorOptions extends CollectorOptions<[Message, Collection]> { max?: number; maxProcessed?: number; } export type MessageComponent = | Component | ActionRowBuilder | ButtonComponent | StringSelectMenuComponent | UserSelectMenuComponent | RoleSelectMenuComponent | MentionableSelectMenuComponent | ChannelSelectMenuComponent; export type CollectedMessageInteraction = Exclude< CollectedInteraction, ModalSubmitInteraction >; export type MessageComponentCollectorOptions = Omit< InteractionCollectorOptions, 'channel' | 'message' | 'guild' | 'interactionType' >; export type MessageChannelComponentCollectorOptions = Omit< InteractionCollectorOptions, 'channel' | 'guild' | 'interactionType' >; export interface MessageEvent { data: WebSocket.Data; type: string; target: WebSocket; } export interface MessageInteraction { id: Snowflake; type: InteractionType; commandName: string; user: User; } export interface MessageMentionsHasOptions { ignoreDirect?: boolean; ignoreRoles?: boolean; ignoreRepliedUser?: boolean; ignoreEveryone?: boolean; } export interface MessageMentionOptions { parse?: MessageMentionTypes[]; roles?: Snowflake[]; users?: Snowflake[]; repliedUser?: boolean; } export type MessageMentionTypes = 'roles' | 'users' | 'everyone'; export interface BaseMessageOptions { content?: string; embeds?: (JSONEncodable | APIEmbed)[]; allowedMentions?: MessageMentionOptions; files?: ( | BufferResolvable | Stream | JSONEncodable | Attachment | AttachmentBuilder | AttachmentPayload )[]; components?: ( | JSONEncodable> | ActionRowData | APIActionRowComponent )[]; } export interface MessageCreateOptions extends BaseMessageOptions { tts?: boolean; nonce?: string | number; reply?: ReplyOptions; stickers?: StickerResolvable[]; flags?: BitFieldResolvable< Extract, MessageFlags.SuppressEmbeds | MessageFlags.SuppressNotifications >; } export type GuildForumThreadMessageCreateOptions = BaseMessageOptions & Pick; export interface MessageEditOptions extends Omit { content?: string | null; attachments?: JSONEncodable[]; flags?: BitFieldResolvable, MessageFlags.SuppressEmbeds>; } export type MessageReactionResolvable = MessageReaction | Snowflake | string; export interface MessageReference { channelId: Snowflake; guildId: Snowflake | undefined; messageId: Snowflake | undefined; } export type MessageResolvable = Message | Snowflake; export interface BaseSelectMenuComponentData extends BaseComponentData { customId: string; disabled?: boolean; maxValues?: number; minValues?: number; placeholder?: string; } export interface StringSelectMenuComponentData extends BaseSelectMenuComponentData { type: ComponentType.StringSelect; options: SelectMenuComponentOptionData[]; } export interface UserSelectMenuComponentData extends BaseSelectMenuComponentData { type: ComponentType.UserSelect; } export interface RoleSelectMenuComponentData extends BaseSelectMenuComponentData { type: ComponentType.RoleSelect; } export interface MentionableSelectMenuComponentData extends BaseSelectMenuComponentData { type: ComponentType.MentionableSelect; } export interface ChannelSelectMenuComponentData extends BaseSelectMenuComponentData { type: ComponentType.ChannelSelect; channelTypes?: ChannelType[]; } export interface MessageSelectOption { default: boolean; description: string | null; emoji: APIPartialEmoji | null; label: string; value: string; } export interface SelectMenuComponentOptionData { default?: boolean; description?: string; emoji?: ComponentEmojiResolvable; label: string; value: string; } export interface TextInputComponentData extends BaseComponentData { type: ComponentType.TextInput; customId: string; style: TextInputStyle; label: string; minLength?: number; maxLength?: number; required?: boolean; value?: string; placeholder?: string; } export type MessageTarget = | Interaction | InteractionWebhook | TextBasedChannel | User | GuildMember | Webhook | WebhookClient | Message | MessageManager; export interface MultipleShardRespawnOptions { shardDelay?: number; respawnDelay?: number; timeout?: number; } export interface MultipleShardSpawnOptions { amount?: number | 'auto'; delay?: number; timeout?: number; } export interface OverwriteData { allow?: PermissionResolvable; deny?: PermissionResolvable; id: GuildMemberResolvable | RoleResolvable; type?: OverwriteType; } export type OverwriteResolvable = PermissionOverwrites | OverwriteData; export type PermissionFlags = Record; export type PermissionOverwriteOptions = Partial>; export type PermissionResolvable = BitFieldResolvable; export type PermissionOverwriteResolvable = UserResolvable | RoleResolvable | PermissionOverwrites; export type RecursiveArray = ReadonlyArray>; export type RecursiveReadonlyArray = ReadonlyArray>; export interface PartialRecipient { username: string; } export interface PresenceData { status?: PresenceStatusData; afk?: boolean; activities?: ActivitiesOptions[]; shardId?: number | number[]; } export type PresenceResolvable = Presence | UserResolvable | Snowflake; export interface PartialChannelData { id?: Snowflake | number; parentId?: Snowflake | number; type?: ChannelType.GuildText | ChannelType.GuildVoice | ChannelType.GuildCategory; name: string; topic?: string | null; nsfw?: boolean; bitrate?: number; userLimit?: number; rtcRegion?: string | null; videoQualityMode?: VideoQualityMode; permissionOverwrites?: PartialOverwriteData[]; rateLimitPerUser?: number; } export type Partialize< T extends AllowedPartial, N extends keyof T | null = null, M extends keyof T | null = null, E extends keyof T | '' = '', > = { readonly client: Client; id: Snowflake; partial: true; } & { [K in keyof Omit]: K extends N ? null : K extends M ? T[K] | null : T[K]; }; export interface PartialDMChannel extends Partialize { lastMessageId: undefined; } export interface PartialGuildMember extends Partialize {} export interface PartialMessage extends Partialize {} export interface PartialMessageReaction extends Partialize {} export interface PartialThreadMember extends Partialize {} export interface PartialOverwriteData { id: Snowflake | number; type?: OverwriteType; allow?: PermissionResolvable; deny?: PermissionResolvable; } export interface PartialRoleData extends RoleData { id?: Snowflake | number; } export enum Partials { User, Channel, GuildMember, Message, Reaction, GuildScheduledEvent, ThreadMember, } export interface PartialUser extends Partialize {} export type PresenceStatusData = ClientPresenceStatus | 'invisible'; export type PresenceStatus = PresenceStatusData | 'offline'; export interface ReactionCollectorOptions extends CollectorOptions<[MessageReaction, User]> { max?: number; maxEmojis?: number; maxUsers?: number; } export interface ReplyOptions { messageReference: MessageResolvable; failIfNotExists?: boolean; } export interface MessageReplyOptions extends Omit { failIfNotExists?: boolean; } export interface ResolvedOverwriteOptions { allow: PermissionsBitField; deny: PermissionsBitField; } export interface RoleData { name?: string; color?: ColorResolvable; hoist?: boolean; position?: number; permissions?: PermissionResolvable; mentionable?: boolean; icon?: BufferResolvable | Base64Resolvable | EmojiResolvable | null; unicodeEmoji?: string | null; } export type RoleMention = '@everyone' | `<@&${Snowflake}>`; export interface RolePosition { role: RoleResolvable; position: number; } export type RoleResolvable = Role | Snowflake; export interface RoleSubscriptionData { roleSubscriptionListingId: Snowflake; tierName: string; totalMonthsSubscribed: number; isRenewal: boolean; } export interface RoleTagData { botId?: Snowflake; integrationId?: Snowflake; premiumSubscriberRole?: true; subscriptionListingId?: Snowflake; availableForPurchase?: true; guildConnections?: true; } export interface SetChannelPositionOptions { relative?: boolean; reason?: string; } export interface SetParentOptions { lockPermissions?: boolean; reason?: string; } export interface SetRolePositionOptions { relative?: boolean; reason?: string; } export type ShardingManagerMode = 'process' | 'worker'; export interface ShardingManagerOptions { totalShards?: number | 'auto'; shardList?: number[] | 'auto'; mode?: ShardingManagerMode; respawn?: boolean; silent?: boolean; shardArgs?: string[]; token?: string; execArgv?: string[]; } export { Snowflake }; export type StageInstanceResolvable = StageInstance | Snowflake; export interface StartThreadOptions { name: string; autoArchiveDuration?: ThreadAutoArchiveDuration; reason?: string; rateLimitPerUser?: number; } export type ClientStatus = number; export type StickerResolvable = Sticker | Snowflake; export type SystemChannelFlagsResolvable = BitFieldResolvable; export type StageChannelResolvable = StageChannel | Snowflake; export interface StageInstanceEditOptions { topic?: string; privacyLevel?: StageInstancePrivacyLevel; } export type SweeperKey = keyof SweeperDefinitions; export type CollectionSweepFilter = (value: V, key: K, collection: Collection) => boolean; export interface SweepOptions { interval: number; filter: GlobalSweepFilter; } export interface LifetimeSweepOptions { interval: number; lifetime: number; filter?: never; } export interface SweeperDefinitions { applicationCommands: [Snowflake, ApplicationCommand]; autoModerationRules: [Snowflake, AutoModerationRule]; bans: [Snowflake, GuildBan]; emojis: [Snowflake, GuildEmoji]; invites: [string, Invite, true]; guildMembers: [Snowflake, GuildMember]; messages: [Snowflake, Message, true]; presences: [Snowflake, Presence]; reactions: [string | Snowflake, MessageReaction]; stageInstances: [Snowflake, StageInstance]; stickers: [Snowflake, Sticker]; threadMembers: [Snowflake, ThreadMember]; threads: [Snowflake, AnyThreadChannel, true]; users: [Snowflake, User]; voiceStates: [Snowflake, VoiceState]; } export type SweeperOptions = { [K in keyof SweeperDefinitions]?: SweeperDefinitions[K][2] extends true ? SweepOptions | LifetimeSweepOptions : SweepOptions; }; export interface LimitedCollectionOptions { maxSize?: number; keepOverLimit?: (value: V, key: K, collection: LimitedCollection) => boolean; } export type Channel = | CategoryChannel | DMChannel | PartialDMChannel | PartialGroupDMChannel | NewsChannel | StageChannel | TextChannel | AnyThreadChannel | VoiceChannel | ForumChannel; export type TextBasedChannel = Exclude< Extract, PartialGroupDMChannel | ForumChannel >; export type TextBasedChannelTypes = TextBasedChannel['type']; export type GuildTextBasedChannelTypes = Exclude; export type VoiceBasedChannel = Extract; export type GuildBasedChannel = Extract; export type CategoryChildChannel = Exclude, CategoryChannel>; export type NonThreadGuildBasedChannel = Exclude; export type GuildTextBasedChannel = Extract; export type TextChannelResolvable = Snowflake | TextChannel; export type TextBasedChannelResolvable = Snowflake | TextBasedChannel; export type ThreadChannelResolvable = AnyThreadChannel | Snowflake; export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread; export interface GuildTextThreadCreateOptions extends StartThreadOptions { startMessage?: MessageResolvable; type?: AllowedThreadType; invitable?: AllowedThreadType extends ChannelType.PrivateThread ? boolean : never; } export interface GuildForumThreadCreateOptions extends StartThreadOptions { message: GuildForumThreadMessageCreateOptions | MessagePayload; appliedTags?: Snowflake[]; } export interface ThreadEditOptions { name?: string; archived?: boolean; autoArchiveDuration?: ThreadAutoArchiveDuration; rateLimitPerUser?: number; locked?: boolean; invitable?: boolean; appliedTags?: Snowflake[]; flags?: ChannelFlagsResolvable; reason?: string; } export type ThreadMemberResolvable = ThreadMember | UserResolvable; export type UserMention = `<@${Snowflake}>`; export type UserResolvable = User | Snowflake | Message | GuildMember | ThreadMember; export interface Vanity { code: string | null; uses: number; } export type VoiceBasedChannelTypes = VoiceBasedChannel['type']; export type VoiceChannelResolvable = Snowflake | VoiceChannel; export interface VoiceStateEditOptions { requestToSpeak?: boolean; suppressed?: boolean; } export type WebhookClientData = WebhookClientDataIdWithToken | WebhookClientDataURL; export interface WebhookClientDataIdWithToken { id: Snowflake; token: string; } export interface WebhookClientDataURL { url: string; } export type WebhookClientOptions = Pick; export interface WebhookDeleteOptions { token?: string; reason?: string; } export interface WebhookEditOptions { name?: string; avatar?: BufferResolvable | null; channel?: GuildTextChannelResolvable | VoiceChannel | ForumChannel | StageChannel; reason?: string; } export interface WebhookMessageEditOptions extends Omit { threadId?: Snowflake; } export interface InteractionEditReplyOptions extends WebhookMessageEditOptions { message?: MessageResolvable | '@original'; } export interface WebhookFetchMessageOptions { threadId?: Snowflake; } export interface WebhookMessageCreateOptions extends Omit { username?: string; avatarURL?: string; threadId?: Snowflake; threadName?: string; } export interface WebSocketOptions { large_threshold?: number; version?: number; buildStrategy?(manager: WSWebSocketManager): IShardingStrategy; buildIdentifyThrottler?(manager: WSWebSocketManager): Awaitable; } export interface WidgetActivity { name: string; } export interface WidgetChannel { id: Snowflake; name: string; position: number; } export interface WelcomeChannelData { description: string; channel: TextChannel | NewsChannel | ForumChannel | Snowflake; emoji?: EmojiIdentifierResolvable; } export interface WelcomeScreenEditOptions { enabled?: boolean; description?: string; welcomeChannels?: WelcomeChannelData[]; } export interface ClientApplicationInstallParams { scopes: OAuth2Scopes[]; permissions: Readonly; } export type Serialized = T extends symbol | bigint | (() => any) ? never : T extends number | string | boolean | undefined ? T : T extends { toJSON(): infer R } ? R : T extends ReadonlyArray ? Serialized[] : T extends ReadonlyMap | ReadonlySet ? {} : { [K in keyof T]: Serialized }; //#endregion //#region Voice /** * @internal Use `DiscordGatewayAdapterLibraryMethods` from `@discordjs/voice` instead. */ export interface InternalDiscordGatewayAdapterLibraryMethods { onVoiceServerUpdate(data: GatewayVoiceServerUpdateDispatchData): void; onVoiceStateUpdate(data: GatewayVoiceStateUpdateDispatchData): void; destroy(): void; } /** * @internal Use `DiscordGatewayAdapterImplementerMethods` from `@discordjs/voice` instead. */ export interface InternalDiscordGatewayAdapterImplementerMethods { sendPayload(payload: unknown): boolean; destroy(): void; } /** * @internal Use `DiscordGatewayAdapterCreator` from `@discordjs/voice` instead. */ export type InternalDiscordGatewayAdapterCreator = ( methods: InternalDiscordGatewayAdapterLibraryMethods, ) => InternalDiscordGatewayAdapterImplementerMethods; //#endregion // External export * from 'discord-api-types/v10'; export * from '@discordjs/builders'; export * from '@discordjs/formatters'; export * from '@discordjs/rest'; export * from '@discordjs/util'; export * from '@discordjs/ws';