// 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