2022-03-19 10:37:45 +00:00
|
|
|
import {
|
|
|
|
blockQuote,
|
|
|
|
bold,
|
|
|
|
channelMention,
|
2023-03-26 13:32:10 +00:00
|
|
|
chatInputApplicationCommandMention,
|
2022-03-19 10:37:45 +00:00
|
|
|
codeBlock,
|
2022-07-06 12:40:11 +00:00
|
|
|
ContextMenuCommandBuilder,
|
2022-03-19 10:37:45 +00:00
|
|
|
formatEmoji,
|
|
|
|
hideLinkEmbed,
|
|
|
|
hyperlink,
|
|
|
|
inlineCode,
|
|
|
|
italic,
|
|
|
|
quote,
|
|
|
|
roleMention,
|
2022-07-06 12:40:11 +00:00
|
|
|
SlashCommandBuilder,
|
2022-03-19 10:37:45 +00:00
|
|
|
spoiler,
|
|
|
|
strikethrough,
|
|
|
|
time,
|
|
|
|
TimestampStyles,
|
|
|
|
TimestampStylesString,
|
|
|
|
underscore,
|
|
|
|
userMention,
|
|
|
|
} from '@discordjs/builders';
|
2022-06-04 06:26:53 +00:00
|
|
|
import { VoiceConnection } from '@discordjs/voice';
|
2022-03-19 10:37:45 +00:00
|
|
|
import { Collection } from '@discordjs/collection';
|
|
|
|
import {
|
|
|
|
APIActionRowComponent,
|
|
|
|
APIApplicationCommandInteractionData,
|
|
|
|
APIApplicationCommandOption,
|
|
|
|
APIApplicationCommandPermission,
|
|
|
|
APIAuditLogChange,
|
|
|
|
APIButtonComponent,
|
|
|
|
APIEmbed,
|
|
|
|
APIEmoji,
|
|
|
|
APIInteractionDataResolvedChannel,
|
|
|
|
APIInteractionDataResolvedGuildMember,
|
|
|
|
APIInteractionGuildMember,
|
|
|
|
APIMessage,
|
2022-05-14 08:06:15 +00:00
|
|
|
APIMessageActionRowComponent,
|
2022-03-19 10:37:45 +00:00
|
|
|
APIMessageComponent,
|
2022-05-14 08:06:15 +00:00
|
|
|
APIModalActionRowComponent,
|
2022-03-19 10:37:45 +00:00
|
|
|
APIOverwrite,
|
|
|
|
APIPartialChannel,
|
|
|
|
APIPartialEmoji,
|
|
|
|
APIPartialGuild,
|
|
|
|
APIRole,
|
|
|
|
APISelectMenuComponent,
|
|
|
|
APITemplateSerializedSourceGuild,
|
|
|
|
APIUser,
|
2022-07-09 05:31:42 +00:00
|
|
|
MessageActivityType,
|
2022-04-16 04:59:23 +00:00
|
|
|
GatewayOpcodes,
|
2022-03-19 10:37:45 +00:00
|
|
|
GatewayVoiceServerUpdateDispatchData,
|
|
|
|
GatewayVoiceStateUpdateDispatchData,
|
|
|
|
RESTPostAPIApplicationCommandsJSONBody,
|
|
|
|
Snowflake,
|
2022-05-14 08:06:15 +00:00
|
|
|
LocalizationMap,
|
2023-02-28 06:42:35 +00:00
|
|
|
APIGuildMember,
|
|
|
|
APIChannel,
|
2022-03-19 10:37:45 +00:00
|
|
|
} from 'discord-api-types/v9';
|
|
|
|
import { ChildProcess } from 'node:child_process';
|
|
|
|
import { EventEmitter } from 'node:events';
|
|
|
|
import { AgentOptions } from 'node:https';
|
|
|
|
import { Response } from 'node-fetch';
|
|
|
|
import { Stream } from 'node:stream';
|
|
|
|
import { MessagePort, Worker } from 'node:worker_threads';
|
|
|
|
import * as WebSocket from 'ws';
|
|
|
|
import {
|
|
|
|
ActivityTypes,
|
|
|
|
ApplicationCommandOptionTypes,
|
|
|
|
ApplicationCommandPermissionTypes,
|
|
|
|
ApplicationCommandTypes,
|
2022-12-20 15:46:50 +00:00
|
|
|
AutoModerationActionTypes,
|
|
|
|
AutoModerationRuleEventTypes,
|
|
|
|
AutoModerationRuleKeywordPresetTypes,
|
|
|
|
AutoModerationRuleTriggerTypes,
|
2022-03-19 10:37:45 +00:00
|
|
|
ChannelTypes,
|
2022-06-04 06:26:53 +00:00
|
|
|
RelationshipTypes,
|
2022-04-12 05:46:08 +00:00
|
|
|
localeSetting,
|
|
|
|
stickerAnimationMode,
|
|
|
|
DMScanLevel,
|
2022-03-19 10:37:45 +00:00
|
|
|
DefaultMessageNotificationLevels,
|
|
|
|
ExplicitContentFilterLevels,
|
|
|
|
InteractionResponseTypes,
|
|
|
|
InteractionTypes,
|
|
|
|
InviteTargetType,
|
|
|
|
MembershipStates,
|
|
|
|
MessageButtonStyles,
|
|
|
|
MessageComponentTypes,
|
|
|
|
MessageTypes,
|
2022-05-14 08:06:15 +00:00
|
|
|
ModalComponentTypes,
|
2022-03-19 10:37:45 +00:00
|
|
|
MFALevels,
|
2022-11-26 15:17:33 +00:00
|
|
|
NitroType as NitroTypes,
|
|
|
|
HypeSquadType as HypeSquadTypes,
|
|
|
|
localeSetting as localeSettings,
|
2022-03-19 10:37:45 +00:00
|
|
|
NSFWLevels,
|
|
|
|
OverwriteTypes,
|
|
|
|
PremiumTiers,
|
|
|
|
PrivacyLevels,
|
|
|
|
StickerFormatTypes,
|
|
|
|
StickerTypes,
|
2022-05-14 08:06:15 +00:00
|
|
|
TextInputStyles,
|
2022-03-19 10:37:45 +00:00
|
|
|
VerificationLevels,
|
|
|
|
WebhookTypes,
|
|
|
|
GuildScheduledEventEntityTypes,
|
|
|
|
GuildScheduledEventStatuses,
|
|
|
|
GuildScheduledEventPrivacyLevels,
|
2022-08-01 05:31:18 +00:00
|
|
|
HypeSquadType,
|
2022-05-14 08:06:15 +00:00
|
|
|
VideoQualityModes,
|
2022-10-10 05:03:17 +00:00
|
|
|
SortOrderType,
|
2022-12-18 06:17:48 +00:00
|
|
|
SelectMenuComponentTypes,
|
2022-12-25 03:35:06 +00:00
|
|
|
ForumLayoutType,
|
2023-01-26 07:10:27 +00:00
|
|
|
ApplicationRoleConnectionMetadataTypes,
|
2022-03-19 10:37:45 +00:00
|
|
|
} from './enums';
|
|
|
|
import {
|
2023-01-26 07:10:27 +00:00
|
|
|
APIApplicationRoleConnectionMetadata,
|
2022-12-20 15:46:50 +00:00
|
|
|
APIAutoModerationRule,
|
|
|
|
GatewayAutoModerationActionExecutionDispatchData,
|
2022-03-19 10:37:45 +00:00
|
|
|
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,
|
|
|
|
RawMessageAttachmentData,
|
|
|
|
RawMessageButtonInteractionData,
|
|
|
|
RawMessageComponentInteractionData,
|
|
|
|
RawMessageData,
|
|
|
|
RawMessagePayloadData,
|
|
|
|
RawMessageReactionData,
|
|
|
|
RawMessageSelectMenuInteractionData,
|
2022-05-14 08:06:15 +00:00
|
|
|
RawModalSubmitInteractionData,
|
2022-03-19 10:37:45 +00:00
|
|
|
RawOAuth2GuildData,
|
|
|
|
RawPartialGroupDMChannelData,
|
|
|
|
RawPartialMessageData,
|
|
|
|
RawPermissionOverwriteData,
|
|
|
|
RawPresenceData,
|
|
|
|
RawReactionEmojiData,
|
|
|
|
RawRichPresenceAssets,
|
|
|
|
RawRoleData,
|
|
|
|
RawStageInstanceData,
|
|
|
|
RawStickerData,
|
|
|
|
RawStickerPackData,
|
|
|
|
RawTeamData,
|
|
|
|
RawTeamMemberData,
|
2022-05-14 08:06:15 +00:00
|
|
|
RawTextInputComponentData,
|
2022-03-19 10:37:45 +00:00
|
|
|
RawThreadChannelData,
|
|
|
|
RawThreadMemberData,
|
|
|
|
RawTypingData,
|
|
|
|
RawUserData,
|
|
|
|
RawVoiceRegionData,
|
|
|
|
RawVoiceStateData,
|
|
|
|
RawWebhookData,
|
|
|
|
RawWelcomeChannelData,
|
|
|
|
RawWelcomeScreenData,
|
|
|
|
RawWidgetData,
|
|
|
|
RawWidgetMemberData,
|
|
|
|
} from './rawDataTypes';
|
2022-06-04 06:26:53 +00:00
|
|
|
// @ts-ignore
|
2022-03-19 10:37:45 +00:00
|
|
|
//#region Classes
|
2022-08-25 11:20:00 +00:00
|
|
|
|
2023-04-03 10:52:24 +00:00
|
|
|
export class SessionManager extends CachedManager<string, Session, any> {
|
|
|
|
private constructor(client: Client, iterable: Iterable<any>);
|
2022-08-25 11:20:00 +00:00
|
|
|
public fetch(): Promise<SessionManager>;
|
2022-11-08 16:56:17 +00:00
|
|
|
public logoutAllDevices(mfaCode?: string): Promise<undefined>;
|
2022-08-25 11:20:00 +00:00
|
|
|
}
|
|
|
|
|
2023-01-05 11:42:17 +00:00
|
|
|
export class BillingManager extends BaseManager {
|
|
|
|
constructor(client: Client);
|
|
|
|
public paymentSources: Collection<Snowflake, object>;
|
|
|
|
public fetchPaymentSources(): Promise<Collection<Snowflake, object>>;
|
|
|
|
public guildBoosts: Collection<Snowflake, GuildBoost>;
|
|
|
|
public fetchGuildBoosts(): Promise<Collection<Snowflake, GuildBoost>>;
|
|
|
|
public currentSubscription: Collection<Snowflake, object>;
|
|
|
|
public fetchCurrentSubscription(): Promise<Collection<Snowflake, object>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildBoost extends Base {
|
|
|
|
constructor(client: Client, data: object);
|
|
|
|
public id: Snowflake;
|
|
|
|
public guildId?: Snowflake;
|
|
|
|
public readonly guild: Guild | null;
|
|
|
|
public subscriptionId: Snowflake;
|
|
|
|
public premiumGuildSubscriptionId?: Snowflake;
|
|
|
|
public ended?: boolean;
|
|
|
|
public canceled: boolean;
|
|
|
|
public cooldownEndsAt: Date;
|
|
|
|
public unsubscribe(): Promise<this>;
|
|
|
|
public subscribe(guild: GuildResolvable): Promise<this>;
|
|
|
|
}
|
|
|
|
|
2022-11-19 16:26:38 +00:00
|
|
|
export class Session extends Base {
|
2022-08-25 11:20:00 +00:00
|
|
|
constructor(client: Client);
|
|
|
|
public id?: string;
|
|
|
|
public clientInfo?: SessionClientInfo;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public readonly createdAt: Date;
|
2022-11-08 16:56:17 +00:00
|
|
|
public logout(mfaCode?: string): Promise<undefined>;
|
2022-08-25 11:20:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SessionClientInfo {
|
|
|
|
location?: string;
|
|
|
|
platform?: string;
|
|
|
|
os?: string;
|
|
|
|
}
|
|
|
|
|
2022-11-19 16:26:38 +00:00
|
|
|
export class DiscordAuthWebsocket extends EventEmitter {
|
2022-08-18 13:04:00 +00:00
|
|
|
constructor(options?: DiscordAuthWebsocketOptions);
|
|
|
|
public fingerprint?: string;
|
|
|
|
public heartbeatInterval?: number;
|
|
|
|
public ws?: WebSocket;
|
2022-07-11 08:04:07 +00:00
|
|
|
public token?: string;
|
2022-08-20 13:26:56 +00:00
|
|
|
public realToken?: string;
|
2022-07-11 08:04:07 +00:00
|
|
|
public user?: RawUserData;
|
2022-12-22 07:53:27 +00:00
|
|
|
public captchaCache?: Captcha;
|
|
|
|
public captchaHandler(data: Captcha): Promise<string>;
|
2022-08-18 13:04:00 +00:00
|
|
|
public readonly exprireTime: string;
|
|
|
|
public connect(client?: Client): void;
|
2022-07-11 08:04:07 +00:00
|
|
|
public destroy(): void;
|
2022-08-18 13:04:00 +00:00
|
|
|
public generateQR(): void;
|
|
|
|
public on(event: 'ready', listener: (fingerprint: string, authURL: string) => void): this;
|
|
|
|
public on(event: 'finish', listener: (user: RawUserData, token: string) => void): this;
|
2022-07-11 08:07:12 +00:00
|
|
|
public on(event: 'cancel' | 'pending', listener: (user: RawUserData) => void): this;
|
2022-08-18 13:04:00 +00:00
|
|
|
public on(event: 'closed', listener: (token?: string) => void): this;
|
2022-07-11 08:04:07 +00:00
|
|
|
public on(event: string, listener: (...args: any[]) => Awaitable<void>): this;
|
|
|
|
}
|
2023-02-21 09:22:51 +00:00
|
|
|
|
|
|
|
export class DiscordRPCServer extends EventEmitter {
|
|
|
|
constructor(client: Client, debug?: boolean);
|
|
|
|
public debug?: boolean;
|
|
|
|
public client: Client;
|
|
|
|
public on(event: 'activity', listener: (data: RPCActivityData) => void): this;
|
|
|
|
}
|
|
|
|
|
2023-03-05 10:05:40 +00:00
|
|
|
export class Call extends Base {
|
|
|
|
constructor(client: Client, data: object);
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public ringing: Collection<Snowflake, User>;
|
|
|
|
public region?: string;
|
|
|
|
public readonly channel: PartialDMChannel | PartialGroupDMChannel;
|
|
|
|
public setVoiceRegion(region: string): Promise<undefined>;
|
|
|
|
}
|
|
|
|
|
2023-02-21 09:22:51 +00:00
|
|
|
export interface RPCActivityData {
|
|
|
|
activity?: RichPresence;
|
|
|
|
pid: number;
|
|
|
|
socketId: string;
|
|
|
|
}
|
|
|
|
|
2022-08-18 13:04:00 +00:00
|
|
|
export interface DiscordAuthWebsocketOptions {
|
|
|
|
debug: boolean;
|
|
|
|
hiddenLog: boolean;
|
|
|
|
autoLogin: boolean;
|
|
|
|
failIfError: boolean;
|
|
|
|
generateQR: boolean;
|
2022-10-26 12:38:09 +00:00
|
|
|
userAgent?: string;
|
|
|
|
wsProperties?: object;
|
2022-08-18 13:04:00 +00:00
|
|
|
}
|
2022-07-06 18:42:21 +00:00
|
|
|
// RPC by aiko-chan-ai
|
|
|
|
export interface RichButton {
|
|
|
|
name: string;
|
|
|
|
url: string;
|
|
|
|
}
|
|
|
|
|
2022-11-19 16:26:38 +00:00
|
|
|
export class RichPresence {
|
2022-07-23 11:56:49 +00:00
|
|
|
public constructor(client?: Client, data?: object, IPC?: boolean);
|
2022-07-06 18:42:21 +00:00
|
|
|
public application_id: Snowflake | null;
|
|
|
|
public assets: RichPresenceAssets | null;
|
|
|
|
public buttons: string[];
|
|
|
|
public details: string | null;
|
|
|
|
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;
|
2022-07-23 11:56:49 +00:00
|
|
|
public ipc: boolean;
|
2022-07-16 08:43:11 +00:00
|
|
|
public setAssetsLargeImage(image?: any): this;
|
2022-07-06 18:42:21 +00:00
|
|
|
public setAssetsLargeText(text?: string): this;
|
2022-07-16 08:43:11 +00:00
|
|
|
public setAssetsSmallImage(image?: any): this;
|
2022-07-06 18:42:21 +00:00
|
|
|
public setAssetsSmallText(text?: string): this;
|
|
|
|
public setName(name?: string): this;
|
|
|
|
public setURL(url?: string): this;
|
|
|
|
public setType(type?: ActivityType): this;
|
|
|
|
public setApplicationId(id?: Snowflake): this;
|
|
|
|
public setDetails(details?: string): this;
|
|
|
|
public setState(state?: string): this;
|
|
|
|
public setParty(party?: { max: number; current: number; id?: string }): this;
|
|
|
|
public setStartTimestamp(timestamp?: Date): this;
|
|
|
|
public setEndTimestamp(timestamp?: Date): this;
|
|
|
|
public setButtons(...button: RichButton[]): this;
|
|
|
|
public addButton(name: string, url: string): this;
|
2022-08-29 03:29:03 +00:00
|
|
|
public static getExternal(
|
2022-07-16 08:43:11 +00:00
|
|
|
client: Client,
|
|
|
|
applicationId: Snowflake,
|
|
|
|
image1: string,
|
|
|
|
image2: string,
|
|
|
|
): Promise<ExternalAssets[]>;
|
2022-08-29 03:29:03 +00:00
|
|
|
public static getUUID(): string;
|
2022-07-06 18:42:21 +00:00
|
|
|
public toJSON(): object;
|
2022-11-15 13:06:03 +00:00
|
|
|
public toString(): string;
|
2022-07-06 18:42:21 +00:00
|
|
|
}
|
|
|
|
|
2022-07-16 08:43:11 +00:00
|
|
|
export interface ExternalAssets {
|
|
|
|
url: string;
|
|
|
|
external_asset_path: string;
|
|
|
|
}
|
|
|
|
|
2023-02-15 11:54:47 +00:00
|
|
|
export interface SpotifyMetadata {
|
|
|
|
album_id: string;
|
|
|
|
artist_ids: string[];
|
|
|
|
}
|
|
|
|
|
2022-11-19 16:26:38 +00:00
|
|
|
export class SpotifyRPC extends RichPresence {
|
2022-07-06 18:42:21 +00:00
|
|
|
public constructor(client: Client, data?: object);
|
|
|
|
public application_id: Snowflake | null;
|
|
|
|
public client: Client;
|
|
|
|
public assets: RichPresenceAssets | null;
|
|
|
|
public buttons: string[];
|
|
|
|
public details: string | null;
|
|
|
|
public name: string;
|
|
|
|
public sync_id: string;
|
|
|
|
public id: string;
|
|
|
|
public flags: number;
|
|
|
|
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;
|
2023-02-15 11:54:47 +00:00
|
|
|
public metadata: SpotifyMetadata;
|
2022-07-06 18:42:21 +00:00
|
|
|
public setAssetsLargeImage(image?: string): this;
|
|
|
|
public setAssetsSmallImage(image?: string): this;
|
|
|
|
public setSongId(id: string): this;
|
2023-02-15 11:54:47 +00:00
|
|
|
public addArtistId(id: string): this;
|
|
|
|
public setArtistIds(...ids: string[]): this;
|
|
|
|
public setAlbumId(id: string): this;
|
2022-07-06 18:42:21 +00:00
|
|
|
}
|
|
|
|
|
2022-11-19 16:26:38 +00:00
|
|
|
export class CustomStatus {
|
2022-07-06 18:42:21 +00:00
|
|
|
public constructor(data?: object);
|
|
|
|
public emoji: EmojiIdentifierResolvable;
|
|
|
|
public state: string;
|
|
|
|
public setEmoji(emoji?: EmojiIdentifierResolvable): this;
|
|
|
|
public setState(state: string): this;
|
|
|
|
public toJSON(): object;
|
2022-11-15 13:06:03 +00:00
|
|
|
public toString(): string;
|
2022-07-06 18:42:21 +00:00
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class Activity {
|
|
|
|
private constructor(presence: Presence, data?: RawActivityData);
|
2023-04-02 05:46:18 +00:00
|
|
|
public readonly presence: Presence;
|
2022-03-19 10:37:45 +00:00
|
|
|
public applicationId: Snowflake | null;
|
|
|
|
public assets: RichPresenceAssets | null;
|
|
|
|
public buttons: string[];
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public createdTimestamp: number;
|
|
|
|
public details: string | null;
|
|
|
|
public emoji: Emoji | null;
|
|
|
|
public flags: Readonly<ActivityFlags>;
|
|
|
|
public id: string;
|
|
|
|
public name: string;
|
|
|
|
public party: {
|
|
|
|
id: string | null;
|
|
|
|
size: [number, number];
|
|
|
|
} | null;
|
|
|
|
public platform: ActivityPlatform | null;
|
|
|
|
public sessionId: string | null;
|
|
|
|
public state: string | null;
|
|
|
|
public syncId: string | null;
|
|
|
|
public timestamps: {
|
|
|
|
start: Date | null;
|
|
|
|
end: Date | null;
|
|
|
|
} | null;
|
|
|
|
public type: ActivityType;
|
|
|
|
public url: string | null;
|
|
|
|
public equals(activity: Activity): boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ActivityFlags extends BitField<ActivityFlagsString> {
|
|
|
|
public static FLAGS: Record<ActivityFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<ActivityFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
2022-07-07 17:23:41 +00:00
|
|
|
export class PurchasedFlags extends BitField<PurchasedFlagsString> {
|
|
|
|
public static FLAGS: Record<PurchasedFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<PurchasedFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
2022-12-22 12:37:05 +00:00
|
|
|
export class PremiumUsageFlags extends BitField<PremiumUsageFlagsString> {
|
|
|
|
public static FLAGS: Record<PremiumUsageFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<PremiumUsageFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export abstract class AnonymousGuild extends BaseGuild {
|
|
|
|
protected constructor(client: Client, data: RawAnonymousGuildData, immediatePatch?: boolean);
|
|
|
|
public banner: string | null;
|
|
|
|
public description: string | null;
|
|
|
|
public nsfwLevel: NSFWLevel;
|
2022-05-14 08:06:15 +00:00
|
|
|
public premiumSubscriptionCount: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public splash: string | null;
|
|
|
|
public vanityURLCode: string | null;
|
|
|
|
public verificationLevel: VerificationLevel;
|
|
|
|
public bannerURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public splashURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export abstract class Application extends Base {
|
|
|
|
protected constructor(client: Client, data: RawApplicationData);
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public description: string | null;
|
|
|
|
public icon: string | null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string | null;
|
2023-01-26 07:10:27 +00:00
|
|
|
public roleConnectionsVerificationURL: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public coverURL(options?: StaticImageURLOptions): string | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
/** @deprecated This method is deprecated as it is unsupported and will be removed in the next major version. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetchAssets(): Promise<ApplicationAsset[]>;
|
2022-08-03 12:08:32 +00:00
|
|
|
public invite(guildID: Snowflake, permissions?: PermissionResolvable, captcha?: string): Promise<undefined>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public iconURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): string | null;
|
|
|
|
}
|
|
|
|
|
2022-07-10 09:26:40 +00:00
|
|
|
export interface Tester {
|
|
|
|
state: number;
|
|
|
|
user: User;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationEditData {
|
|
|
|
name?: string;
|
|
|
|
description?: string;
|
|
|
|
icon?: BufferResolvable | Base64Resolvable;
|
|
|
|
cover?: BufferResolvable | Base64Resolvable;
|
|
|
|
botPublic?: boolean;
|
|
|
|
botRequireCodeGrant?: boolean;
|
|
|
|
TermsOfService?: string;
|
|
|
|
PrivacyPolicy?: string;
|
|
|
|
flags?: number;
|
|
|
|
redirectURIs?: string[];
|
|
|
|
tags?: string[];
|
|
|
|
}
|
|
|
|
export class DeveloperPortalApplication extends Base {
|
|
|
|
private constructor(client: Client, data: object);
|
|
|
|
public botPublic: boolean | null;
|
|
|
|
public botRequireCodeGrant: boolean | null;
|
|
|
|
public commands: ApplicationCommandManager;
|
|
|
|
public cover: string | null;
|
|
|
|
public flags: Readonly<ApplicationFlags>;
|
|
|
|
public tags: string[];
|
|
|
|
public installParams: ClientApplicationInstallParams | null;
|
|
|
|
public customInstallURL: string | null;
|
|
|
|
public owner: User | Team | null;
|
|
|
|
public readonly partial: boolean;
|
|
|
|
public rpcOrigins: string[];
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public description: string | null;
|
|
|
|
public icon: string | null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string | null;
|
|
|
|
public redirectURIs: string[];
|
|
|
|
public interactionEndpointURL: string | null;
|
|
|
|
public publicKey: string;
|
|
|
|
public testers: Collection<Snowflake, Tester>;
|
|
|
|
public TermsOfService: string | null;
|
|
|
|
public PrivacyPolicy: string | null;
|
2023-01-26 07:10:27 +00:00
|
|
|
public roleConnectionsVerificationURL: string | null;
|
2022-07-10 09:26:40 +00:00
|
|
|
public fetch(): Promise<ClientApplication>;
|
|
|
|
public coverURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
/** @deprecated This method is deprecated as it is unsupported and will be removed in the next major version. */
|
|
|
|
public fetchAssets(): Promise<ApplicationAsset[]>;
|
|
|
|
public iconURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): string | null;
|
|
|
|
public fetchTesters(): Promise<this>;
|
|
|
|
public addTester(username: string, discriminator: string): Promise<DeveloperPortalApplication>;
|
|
|
|
public deleteTester(user: UserResolvable): Promise<DeveloperPortalApplication>;
|
|
|
|
public edit(data: ApplicationEditData): Promise<DeveloperPortalApplication>;
|
|
|
|
public createBot(): Promise<DeveloperPortalApplication>;
|
|
|
|
public resetClientSecret(MFACode?: number): Promise<string>;
|
|
|
|
public resetBotToken(MFACode?: number): Promise<string>;
|
|
|
|
public delete(MFACode?: number): Promise<undefined>;
|
|
|
|
public addAsset(image: BufferResolvable | Base64Resolvable, name: string): Promise<ApplicationAsset>;
|
|
|
|
public deleteAsset(id: string): Promise<undefined>;
|
2023-01-26 07:10:27 +00:00
|
|
|
public fetchRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnectionMetadata[]>;
|
|
|
|
public editRoleConnectionMetadataRecords(
|
|
|
|
records: ApplicationRoleConnectionMetadataEditOptions[],
|
|
|
|
): Promise<ApplicationRoleConnectionMetadata[]>;
|
2022-07-10 09:26:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class DeveloperPortalManager extends BaseManager {
|
|
|
|
constructor(client: Client);
|
|
|
|
public applications: Collection<Snowflake, DeveloperPortalApplication>;
|
|
|
|
public teams: Collection<Snowflake, Team>;
|
|
|
|
public fetch(): Promise<DeveloperPortalManager>;
|
2022-12-22 11:37:59 +00:00
|
|
|
public createTeam(name: string): Promise<Team>;
|
2022-07-10 09:26:40 +00:00
|
|
|
public createApplication(name: string, teamId?: Team | Snowflake): Promise<DeveloperPortalApplication>;
|
|
|
|
public deleteApplication(id: Snowflake, MFACode?: number): Promise<undefined>;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
|
2022-09-10 11:36:16 +00:00
|
|
|
private constructor(client: Client, data: RawApplicationCommandData);
|
2022-03-19 10:37:45 +00:00
|
|
|
public applicationId: Snowflake;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
2022-06-24 02:14:55 +00:00
|
|
|
/** @deprecated Use {@link defaultMemberPermissions} and {@link dmPermission} instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public defaultPermission: boolean;
|
|
|
|
public description: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
public descriptionLocalizations: LocalizationMap | null;
|
|
|
|
public descriptionLocalized: string | null;
|
2022-09-10 11:36:16 +00:00
|
|
|
public readonly guild: Guild | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public guildId: Snowflake | null;
|
|
|
|
public readonly manager: ApplicationCommandManager;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
public nameLocalizations: LocalizationMap | null;
|
|
|
|
public nameLocalized: string | null;
|
|
|
|
public options: (ApplicationCommandOption & { nameLocalized?: string; descriptionLocalized?: string })[];
|
2022-03-19 10:37:45 +00:00
|
|
|
public permissions: ApplicationCommandPermissionsManager<
|
|
|
|
PermissionsFetchType,
|
|
|
|
PermissionsFetchType,
|
|
|
|
PermissionsFetchType,
|
|
|
|
Guild | null,
|
|
|
|
Snowflake
|
|
|
|
>;
|
|
|
|
public type: ApplicationCommandType;
|
|
|
|
public version: Snowflake;
|
|
|
|
public delete(): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-06-24 02:14:55 +00:00
|
|
|
public edit(data: Partial<ApplicationCommandData>): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setName(name: string): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public setNameLocalizations(nameLocalizations: LocalizationMap): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setDescription(description: string): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public setDescriptionLocalizations(
|
|
|
|
descriptionLocalizations: LocalizationMap,
|
|
|
|
): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-06-24 02:14:55 +00:00
|
|
|
/** @deprecated Use {@link setDefaultMemberPermissions} and {@link setDMPermission} instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public setDefaultPermission(defaultPermission?: boolean): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-06-24 02:14:55 +00:00
|
|
|
public setDefaultMemberPermissions(
|
|
|
|
defaultMemberPermissions: PermissionResolvable | null,
|
|
|
|
): Promise<ApplicationCommand<PermissionsFetchType>>;
|
|
|
|
public setDMPermission(dmPermission?: boolean): Promise<ApplicationCommand<PermissionsFetchType>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setOptions(options: ApplicationCommandOptionData[]): Promise<ApplicationCommand<PermissionsFetchType>>;
|
|
|
|
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;
|
2022-03-25 15:57:21 +00:00
|
|
|
// Add
|
2022-08-18 05:11:49 +00:00
|
|
|
public static sendSlashCommand(
|
|
|
|
message: Message,
|
|
|
|
subCommandArray?: string[],
|
2022-11-12 10:39:56 +00:00
|
|
|
options?: any[],
|
2022-10-09 12:37:04 +00:00
|
|
|
): Promise<InteractionResponse>;
|
|
|
|
public static sendContextMenu(message: Message): Promise<InteractionResponse>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2023-01-26 07:10:27 +00:00
|
|
|
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: ApplicationRoleConnectionMetadataTypes;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export type ApplicationResolvable = Application | Activity | Snowflake;
|
|
|
|
|
2022-12-20 15:46:50 +00:00
|
|
|
export type AutoModerationRuleResolvable = AutoModerationRule | Snowflake;
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class ApplicationFlags extends BitField<ApplicationFlagsString> {
|
|
|
|
public static FLAGS: Record<ApplicationFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<ApplicationFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export abstract class Base {
|
|
|
|
public constructor(client: Client);
|
|
|
|
public readonly client: Client;
|
|
|
|
public toJSON(...props: Record<string, boolean | string>[]): unknown;
|
|
|
|
public valueOf(): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BaseClient extends EventEmitter {
|
|
|
|
public constructor(options?: ClientOptions | WebhookClientOptions);
|
|
|
|
private readonly api: unknown;
|
|
|
|
private rest: unknown;
|
|
|
|
private decrementMaxListeners(): void;
|
|
|
|
private incrementMaxListeners(): void;
|
|
|
|
|
|
|
|
public on<K extends keyof BaseClientEvents>(
|
|
|
|
event: K,
|
|
|
|
listener: (...args: BaseClientEvents[K]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
public on<S extends string | symbol>(
|
|
|
|
event: Exclude<S, keyof BaseClientEvents>,
|
|
|
|
listener: (...args: any[]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public once<K extends keyof BaseClientEvents>(
|
|
|
|
event: K,
|
|
|
|
listener: (...args: BaseClientEvents[K]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
public once<S extends string | symbol>(
|
|
|
|
event: Exclude<S, keyof BaseClientEvents>,
|
|
|
|
listener: (...args: any[]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public emit<K extends keyof BaseClientEvents>(event: K, ...args: BaseClientEvents[K]): boolean;
|
|
|
|
public emit<S extends string | symbol>(event: Exclude<S, keyof BaseClientEvents>, ...args: unknown[]): boolean;
|
|
|
|
|
|
|
|
public off<K extends keyof BaseClientEvents>(
|
|
|
|
event: K,
|
|
|
|
listener: (...args: BaseClientEvents[K]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
public off<S extends string | symbol>(
|
|
|
|
event: Exclude<S, keyof BaseClientEvents>,
|
|
|
|
listener: (...args: any[]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public removeAllListeners<K extends keyof BaseClientEvents>(event?: K): this;
|
|
|
|
public removeAllListeners<S extends string | symbol>(event?: Exclude<S, keyof BaseClientEvents>): this;
|
|
|
|
|
|
|
|
public options: ClientOptions | WebhookClientOptions;
|
|
|
|
public destroy(): void;
|
|
|
|
public toJSON(...props: Record<string, boolean | string>[]): unknown;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildCacheMessage<Cached extends CacheType> = CacheTypeReducer<
|
|
|
|
Cached,
|
|
|
|
Message<true>,
|
|
|
|
APIMessage,
|
|
|
|
Message | APIMessage,
|
|
|
|
Message | APIMessage
|
|
|
|
>;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface InteractionResponseFields<Cached extends CacheType = CacheType> {
|
|
|
|
deferred: boolean;
|
|
|
|
ephemeral: boolean | null;
|
|
|
|
replied: boolean;
|
|
|
|
webhook: InteractionWebhook;
|
|
|
|
reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
reply(options: string | MessagePayload | InteractionReplyOptions): Promise<void>;
|
2022-11-26 15:02:34 +00:00
|
|
|
deleteReply(message?: MessageResolvable | '@original'): Promise<void>;
|
|
|
|
editReply(options: string | MessagePayload | InteractionEditReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
deferReply(options?: InteractionDeferReplyOptions): Promise<void>;
|
2022-11-26 15:02:34 +00:00
|
|
|
fetchReply(message?: MessageResolvable | '@original'): Promise<GuildCacheMessage<Cached>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export abstract class BaseCommandInteraction<Cached extends CacheType = CacheType> extends Interaction<Cached> {
|
|
|
|
public readonly command: ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
|
|
|
|
public options: Omit<
|
|
|
|
CommandInteractionOptionResolver<Cached>,
|
|
|
|
| 'getMessage'
|
|
|
|
| 'getFocused'
|
|
|
|
| 'getMentionable'
|
|
|
|
| 'getRole'
|
|
|
|
| 'getNumber'
|
|
|
|
| 'getInteger'
|
|
|
|
| 'getString'
|
|
|
|
| 'getChannel'
|
|
|
|
| 'getBoolean'
|
|
|
|
| 'getSubcommandGroup'
|
|
|
|
| 'getSubcommand'
|
2022-05-14 08:06:15 +00:00
|
|
|
| 'getAttachment'
|
2022-03-19 10:37:45 +00:00
|
|
|
>;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public commandId: Snowflake;
|
|
|
|
public commandName: string;
|
|
|
|
public deferred: boolean;
|
|
|
|
public ephemeral: boolean | null;
|
|
|
|
public replied: boolean;
|
|
|
|
public webhook: InteractionWebhook;
|
2022-05-14 08:06:15 +00:00
|
|
|
public awaitModalSubmit(
|
|
|
|
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
|
|
|
): Promise<ModalSubmitInteraction<Cached>>;
|
|
|
|
public inGuild(): this is BaseCommandInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is BaseCommandInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is BaseCommandInteraction<'raw'>;
|
|
|
|
public deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public deferReply(options?: InteractionDeferReplyOptions): Promise<void>;
|
2022-11-26 15:02:34 +00:00
|
|
|
public deleteReply(message?: MessageResolvable | '@original'): Promise<void>;
|
|
|
|
public editReply(options: string | MessagePayload | InteractionEditReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public fetchReply(message?: MessageResolvable | '@original'): Promise<GuildCacheMessage<Cached>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public reply(options: string | MessagePayload | InteractionReplyOptions): Promise<void>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public showModal(modal: Modal | ModalOptions): Promise<void>;
|
2022-03-19 10:37:45 +00:00
|
|
|
private transformOption(
|
|
|
|
option: APIApplicationCommandOption,
|
|
|
|
resolved: APIApplicationCommandInteractionData['resolved'],
|
|
|
|
): CommandInteractionOption<Cached>;
|
|
|
|
private transformResolved(
|
|
|
|
resolved: APIApplicationCommandInteractionData['resolved'],
|
|
|
|
): CommandInteractionResolvedData<Cached>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export abstract class BaseGuild extends Base {
|
|
|
|
protected constructor(client: Client, data: RawBaseGuildData);
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public features: GuildFeatures[];
|
|
|
|
public icon: string | null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string;
|
|
|
|
public readonly nameAcronym: string;
|
|
|
|
public readonly partnered: boolean;
|
|
|
|
public readonly verified: boolean;
|
|
|
|
public fetch(): Promise<Guild>;
|
|
|
|
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 readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public guild: Guild | GuildPreview;
|
|
|
|
public id: Snowflake;
|
|
|
|
public managed: boolean | null;
|
|
|
|
public requiresColons: boolean | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BaseGuildTextChannel extends TextBasedChannelMixin(GuildChannel) {
|
|
|
|
protected constructor(guild: Guild, data?: RawGuildChannelData, client?: Client, immediatePatch?: boolean);
|
|
|
|
public defaultAutoArchiveDuration?: ThreadAutoArchiveDuration;
|
2022-06-06 04:21:36 +00:00
|
|
|
public rateLimitPerUser: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public nsfw: boolean;
|
2022-10-03 12:25:39 +00:00
|
|
|
public threads: GuildTextThreadManager<AllowedThreadTypeForTextChannel | AllowedThreadTypeForNewsChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public topic: string | null;
|
|
|
|
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
|
|
|
|
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
|
|
|
|
public setDefaultAutoArchiveDuration(
|
2022-05-14 08:06:15 +00:00
|
|
|
defaultAutoArchiveDuration: ThreadAutoArchiveDuration | 'MAX',
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string,
|
|
|
|
): Promise<this>;
|
|
|
|
public setTopic(topic: string | null, reason?: string): Promise<this>;
|
|
|
|
public setType(type: Pick<typeof ChannelTypes, 'GUILD_TEXT'>, reason?: string): Promise<TextChannel>;
|
|
|
|
public setType(type: Pick<typeof ChannelTypes, 'GUILD_NEWS'>, reason?: string): Promise<NewsChannel>;
|
|
|
|
}
|
|
|
|
|
2023-04-15 12:53:43 +00:00
|
|
|
export class BaseGuildVoiceChannel extends TextBasedChannelMixin(GuildChannel, ['lastPinTimestamp', 'lastPinAt']) {
|
2022-06-06 04:21:36 +00:00
|
|
|
public constructor(guild: Guild, data?: RawGuildChannelData);
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly members: Collection<Snowflake, GuildMember>;
|
|
|
|
public readonly full: boolean;
|
|
|
|
public readonly joinable: boolean;
|
|
|
|
public bitrate: number;
|
2023-04-15 12:53:43 +00:00
|
|
|
public nsfw: boolean;
|
|
|
|
public rtcRegion: string | null;
|
|
|
|
public rateLimitPerUser: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public userLimit: number;
|
2023-04-15 12:53:43 +00:00
|
|
|
public videoQualityMode: VideoQualityMode | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public setRTCRegion(rtcRegion: string | null, reason?: string): Promise<this>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
|
2023-04-15 12:53:43 +00:00
|
|
|
public setBitrate(bitrate: number, reason?: string): Promise<VoiceChannel>;
|
|
|
|
public setUserLimit(userLimit: number, reason?: string): Promise<VoiceChannel>;
|
|
|
|
public setVideoQualityMode(videoQualityMode: VideoQualityMode | number, reason?: string): Promise<VoiceChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class BaseMessageComponent {
|
|
|
|
protected constructor(data?: BaseMessageComponent | BaseMessageComponentOptions);
|
|
|
|
public type: MessageComponentType | null;
|
|
|
|
private static create(data: MessageComponentOptions, client?: Client | WebhookClient): MessageComponent | undefined;
|
|
|
|
private static resolveType(type: MessageComponentTypeResolvable): MessageComponentType;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BitField<S extends string, N extends number | bigint = number> {
|
|
|
|
public constructor(bits?: BitFieldResolvable<S, N>);
|
|
|
|
public bitfield: N;
|
|
|
|
public add(...bits: BitFieldResolvable<S, N>[]): BitField<S, N>;
|
|
|
|
public any(bit: BitFieldResolvable<S, N>): boolean;
|
|
|
|
public equals(bit: BitFieldResolvable<S, N>): boolean;
|
|
|
|
public freeze(): Readonly<BitField<S, N>>;
|
|
|
|
public has(bit: BitFieldResolvable<S, N>): boolean;
|
|
|
|
public missing(bits: BitFieldResolvable<S, N>, ...hasParams: readonly unknown[]): S[];
|
|
|
|
public remove(...bits: BitFieldResolvable<S, N>[]): BitField<S, N>;
|
|
|
|
public serialize(...hasParams: readonly unknown[]): Record<S, boolean>;
|
|
|
|
public toArray(...hasParams: readonly unknown[]): S[];
|
|
|
|
public toJSON(): N extends number ? number : string;
|
|
|
|
public valueOf(): N;
|
|
|
|
public [Symbol.iterator](): IterableIterator<S>;
|
|
|
|
public static FLAGS: Record<string, number | bigint>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<string, number | bigint>): number | bigint;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ButtonInteraction<Cached extends CacheType = CacheType> extends MessageComponentInteraction<Cached> {
|
|
|
|
private constructor(client: Client, data: RawMessageButtonInteractionData);
|
|
|
|
public readonly component: CacheTypeReducer<
|
|
|
|
Cached,
|
|
|
|
MessageButton,
|
|
|
|
APIButtonComponent,
|
|
|
|
MessageButton | APIButtonComponent,
|
|
|
|
MessageButton | APIButtonComponent
|
|
|
|
>;
|
|
|
|
public componentType: 'BUTTON';
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is ButtonInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is ButtonInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is ButtonInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type KeyedEnum<K, T> = {
|
|
|
|
[Key in keyof K]: T | string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type EnumValueMapped<E extends KeyedEnum<T, number>, T extends Partial<Record<keyof E, unknown>>> = T & {
|
|
|
|
[Key in keyof T as E[Key]]: T[Key];
|
|
|
|
};
|
|
|
|
|
|
|
|
export type MappedChannelCategoryTypes = EnumValueMapped<
|
|
|
|
typeof ChannelTypes,
|
|
|
|
{
|
|
|
|
GUILD_NEWS: NewsChannel;
|
|
|
|
GUILD_VOICE: VoiceChannel;
|
|
|
|
GUILD_TEXT: TextChannel;
|
|
|
|
GUILD_STORE: StoreChannel;
|
|
|
|
GUILD_STAGE_VOICE: StageChannel;
|
2022-10-03 12:25:39 +00:00
|
|
|
GUILD_FORUM: ForumChannel;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
>;
|
|
|
|
|
|
|
|
export type CategoryChannelTypes = ExcludeEnum<
|
|
|
|
typeof ChannelTypes,
|
|
|
|
| 'DM'
|
|
|
|
| 'GROUP_DM'
|
|
|
|
| 'UNKNOWN'
|
|
|
|
| 'GUILD_PUBLIC_THREAD'
|
|
|
|
| 'GUILD_NEWS_THREAD'
|
|
|
|
| 'GUILD_PRIVATE_THREAD'
|
|
|
|
| 'GUILD_CATEGORY'
|
2022-05-14 08:06:15 +00:00
|
|
|
| 'GUILD_DIRECTORY'
|
2022-03-19 10:37:45 +00:00
|
|
|
>;
|
|
|
|
|
|
|
|
export class CategoryChannel extends GuildChannel {
|
|
|
|
public readonly children: Collection<Snowflake, Exclude<NonThreadGuildBasedChannel, CategoryChannel>>;
|
|
|
|
public type: 'GUILD_CATEGORY';
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
public createChannel<T extends Exclude<CategoryChannelTypes, 'GUILD_STORE' | ChannelTypes.GUILD_STORE>>(
|
2022-03-19 10:37:45 +00:00
|
|
|
name: string,
|
|
|
|
options: CategoryCreateChannelOptions & { type: T },
|
|
|
|
): Promise<MappedChannelCategoryTypes[T]>;
|
|
|
|
|
2022-08-14 10:17:37 +00:00
|
|
|
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */
|
2022-03-19 10:37:45 +00:00
|
|
|
public createChannel(
|
|
|
|
name: string,
|
|
|
|
options: CategoryCreateChannelOptions & { type: 'GUILD_STORE' | ChannelTypes.GUILD_STORE },
|
|
|
|
): Promise<StoreChannel>;
|
|
|
|
public createChannel(name: string, options?: CategoryCreateChannelOptions): Promise<TextChannel>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type CategoryChannelResolvable = Snowflake | CategoryChannel;
|
|
|
|
|
|
|
|
export abstract class Channel extends Base {
|
|
|
|
public constructor(client: Client, data?: RawChannelData, immediatePatch?: boolean);
|
2022-05-14 08:06:15 +00:00
|
|
|
public readonly createdAt: Date | null;
|
|
|
|
public readonly createdTimestamp: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public id: Snowflake;
|
|
|
|
public readonly partial: false;
|
|
|
|
public type: keyof typeof ChannelTypes;
|
2022-10-03 12:25:39 +00:00
|
|
|
public flags: Readonly<ChannelFlags> | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public delete(): Promise<this>;
|
|
|
|
public fetch(force?: boolean): Promise<this>;
|
|
|
|
public isText(): this is TextBasedChannel;
|
|
|
|
public isVoice(): this is BaseGuildVoiceChannel;
|
|
|
|
public isThread(): this is ThreadChannel;
|
2022-05-14 08:06:15 +00:00
|
|
|
public isDirectory(): this is DirectoryChannel;
|
2022-03-19 10:37:45 +00:00
|
|
|
public toString(): ChannelMention;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type If<T extends boolean, A, B = null> = T extends true ? A : T extends false ? B : A | B;
|
|
|
|
|
2022-07-11 08:04:07 +00:00
|
|
|
export interface remoteAuthConfrim {
|
|
|
|
yes(): Promise<undefined>;
|
|
|
|
no(): Promise<undefined>;
|
|
|
|
}
|
2022-03-19 10:37:45 +00:00
|
|
|
export class Client<Ready extends boolean = boolean> extends BaseClient {
|
2022-04-14 03:56:21 +00:00
|
|
|
public constructor(options?: ClientOptions); /* Bug report by Mavri#0001 [721347809667973141] */
|
2022-03-19 10:37:45 +00:00
|
|
|
private actions: unknown;
|
|
|
|
private presence: ClientPresence;
|
|
|
|
private _eval(script: string): unknown;
|
2022-03-24 10:55:32 +00:00
|
|
|
private _validateOptions(options: ClientOptions): void;
|
2022-07-09 12:47:00 +00:00
|
|
|
private autoRedeemNitro(message: Message): object;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
public application: If<Ready, ClientApplication>;
|
|
|
|
// Added
|
2023-01-08 07:06:42 +00:00
|
|
|
public settings: ClientUserSettingManager;
|
2022-09-09 16:44:45 +00:00
|
|
|
public relationships: RelationshipManager;
|
2022-08-14 10:16:51 +00:00
|
|
|
public readonly callVoice?: VoiceConnection;
|
|
|
|
public voiceStates: VoiceStateManager;
|
2023-01-05 11:42:17 +00:00
|
|
|
public sessions: SessionManager;
|
|
|
|
public billing: BillingManager;
|
2022-03-19 10:37:45 +00:00
|
|
|
// End
|
2022-03-24 10:55:32 +00:00
|
|
|
public channels: ChannelManager;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly emojis: BaseGuildEmojiManager;
|
|
|
|
public guilds: GuildManager;
|
|
|
|
public options: ClientOptions;
|
|
|
|
public readyAt: If<Ready, Date>;
|
|
|
|
public readonly readyTimestamp: If<Ready, number>;
|
|
|
|
public sweepers: Sweepers;
|
|
|
|
public shard: ShardClientUtil | null;
|
|
|
|
public token: If<Ready, string, string | null>;
|
|
|
|
public uptime: If<Ready, number>;
|
|
|
|
public user: If<Ready, ClientUser>;
|
|
|
|
public users: UserManager;
|
|
|
|
public voice: ClientVoiceManager;
|
|
|
|
public ws: WebSocketManager;
|
2022-04-16 12:01:05 +00:00
|
|
|
public password: string | null;
|
2022-11-15 13:06:03 +00:00
|
|
|
public readonly sessionId: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public destroy(): void;
|
2022-06-26 06:40:26 +00:00
|
|
|
public logout(): Promise<void>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetchGuildPreview(guild: GuildResolvable): Promise<GuildPreview>;
|
|
|
|
public fetchInvite(invite: InviteResolvable, options?: ClientFetchInviteOptions): Promise<Invite>;
|
2023-02-09 12:26:39 +00:00
|
|
|
public acceptInvite(invite: InviteResolvable): Promise<undefined>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetchGuildTemplate(template: GuildTemplateResolvable): Promise<GuildTemplate>;
|
|
|
|
public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
|
|
|
|
public fetchSticker(id: Snowflake): Promise<Sticker>;
|
|
|
|
public fetchPremiumStickerPacks(): Promise<Collection<Snowflake, StickerPack>>;
|
|
|
|
public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
|
|
|
|
public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>;
|
2022-07-09 12:47:00 +00:00
|
|
|
public redeemNitro(code: string, channel?: TextChannelResolvable, failIfNotExists?: boolean): object;
|
2022-03-24 10:55:32 +00:00
|
|
|
public generateInvite(options?: InviteGenerationOptions): string;
|
|
|
|
public login(token?: string): Promise<string>;
|
2022-11-08 16:56:17 +00:00
|
|
|
public normalLogin(username: string, password?: string, mfaCode?: string): Promise<string>;
|
2023-01-26 06:40:51 +00:00
|
|
|
public switchUser(token: string): void;
|
2023-03-02 04:59:05 +00:00
|
|
|
public QRLogin(options?: DiscordAuthWebsocketOptions): DiscordAuthWebsocket;
|
2022-07-11 08:04:07 +00:00
|
|
|
public remoteAuth(url: string, forceAccept?: boolean): Promise<remoteAuthConfrim | undefined>;
|
|
|
|
public createToken(): Promise<string>;
|
2022-11-15 13:06:03 +00:00
|
|
|
public checkUpdate(): Promise<this>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public isReady(): this is Client<true>;
|
|
|
|
/** @deprecated Use {@link Sweepers#sweepMessages} instead */
|
|
|
|
public sweepMessages(lifetime?: number): number;
|
2022-07-23 12:21:37 +00:00
|
|
|
public customStatusAuto(client?: this): undefined;
|
|
|
|
public authorizeURL(url: string, options?: object): Promise<boolean>;
|
2022-11-19 02:45:12 +00:00
|
|
|
public sleep(milliseconds: number): Promise<void> | null;
|
2023-01-26 06:40:51 +00:00
|
|
|
private _clearCache(cache: Collection<any, any>): void;
|
2022-03-19 10:37:45 +00:00
|
|
|
public toJSON(): unknown;
|
|
|
|
|
|
|
|
public on<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => Awaitable<void>): this;
|
|
|
|
public on<S extends string | symbol>(
|
|
|
|
event: Exclude<S, keyof ClientEvents>,
|
|
|
|
listener: (...args: any[]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public once<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => Awaitable<void>): this;
|
|
|
|
public once<S extends string | symbol>(
|
|
|
|
event: Exclude<S, keyof ClientEvents>,
|
|
|
|
listener: (...args: any[]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public emit<K extends keyof ClientEvents>(event: K, ...args: ClientEvents[K]): boolean;
|
|
|
|
public emit<S extends string | symbol>(event: Exclude<S, keyof ClientEvents>, ...args: unknown[]): boolean;
|
|
|
|
|
|
|
|
public off<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => Awaitable<void>): this;
|
|
|
|
public off<S extends string | symbol>(
|
|
|
|
event: Exclude<S, keyof ClientEvents>,
|
|
|
|
listener: (...args: any[]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public removeAllListeners<K extends keyof ClientEvents>(event?: K): this;
|
|
|
|
public removeAllListeners<S extends string | symbol>(event?: Exclude<S, keyof ClientEvents>): this;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClientApplication extends Application {
|
|
|
|
private constructor(client: Client, data: RawClientApplicationData);
|
|
|
|
public botPublic: boolean | null;
|
2022-09-09 16:44:45 +00:00
|
|
|
public popularCommands: Collection<Snowflake, ApplicationCommand> | undefined;
|
2022-03-19 10:37:45 +00:00
|
|
|
public botRequireCodeGrant: boolean | null;
|
|
|
|
public commands: ApplicationCommandManager;
|
|
|
|
public cover: string | null;
|
|
|
|
public flags: Readonly<ApplicationFlags>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public tags: string[];
|
|
|
|
public installParams: ClientApplicationInstallParams | null;
|
|
|
|
public customInstallURL: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public owner: User | Team | null;
|
|
|
|
public readonly partial: boolean;
|
|
|
|
public rpcOrigins: string[];
|
|
|
|
public fetch(): Promise<ClientApplication>;
|
2023-01-26 07:10:27 +00:00
|
|
|
public fetchRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnectionMetadata[]>;
|
|
|
|
public editRoleConnectionMetadataRecords(
|
|
|
|
records: ApplicationRoleConnectionMetadataEditOptions[],
|
|
|
|
): Promise<ApplicationRoleConnectionMetadata[]>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 readonly presence: ClientPresence;
|
|
|
|
public verified: boolean;
|
2022-09-16 12:08:15 +00:00
|
|
|
public notes: Collection<Snowflake, string>;
|
|
|
|
public friendNicknames: Collection<Snowflake, string>;
|
2022-12-22 12:37:05 +00:00
|
|
|
public purchasedFlags: PurchasedFlags;
|
|
|
|
public premiumUsageFlags: PremiumUsageFlags;
|
2022-10-26 12:38:09 +00:00
|
|
|
public setThemeColors(primary?: ColorResolvable, accent?: ColorResolvable): ClientUser;
|
2022-03-19 10:37:45 +00:00
|
|
|
public edit(data: ClientUserEditData): Promise<this>;
|
|
|
|
public setActivity(options?: ActivityOptions): ClientPresence;
|
|
|
|
public setActivity(name: string, options?: ActivityOptions): ClientPresence;
|
|
|
|
public setAFK(afk?: boolean, shardId?: number | number[]): ClientPresence;
|
|
|
|
public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise<this>;
|
2022-03-30 12:50:57 +00:00
|
|
|
public setBanner(banner: BufferResolvable | Base64Resolvable | null): Promise<this>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setPresence(data: PresenceData): ClientPresence;
|
|
|
|
public setStatus(status: PresenceStatusData, shardId?: number | number[]): ClientPresence;
|
2022-03-30 12:50:57 +00:00
|
|
|
public setUsername(username: string, password: string): Promise<this>;
|
2022-08-01 05:31:18 +00:00
|
|
|
public setHypeSquad(type: HypeSquadType): Promise<void>;
|
2022-03-30 12:50:57 +00:00
|
|
|
public setAccentColor(color: ColorResolvable): Promise<this>;
|
|
|
|
public setDiscriminator(discriminator: string, password: string): Promise<this>;
|
2022-08-04 12:26:16 +00:00
|
|
|
public setAboutMe(bio: string | null): Promise<this>;
|
2022-03-30 12:50:57 +00:00
|
|
|
public setEmail(email: string, password: string): Promise<this>;
|
|
|
|
public setPassword(oldPassword: string, newPassword: string): Promise<this>;
|
|
|
|
public disableAccount(password: string): Promise<this>;
|
|
|
|
public deleteAccount(password: string): Promise<this>;
|
2022-04-27 13:58:06 +00:00
|
|
|
public setDeaf(status: boolean): Promise<boolean>;
|
|
|
|
public setMute(status: boolean): Promise<boolean>;
|
2022-05-12 04:58:53 +00:00
|
|
|
public getInvite(options?: CreateInviteOptions): Promise<Invite>;
|
2023-02-21 09:53:34 +00:00
|
|
|
public setSamsungActivity(packageName: string, type?: 'START' | 'UPDATE' | 'STOP'): Promise<this>;
|
2022-06-15 16:07:24 +00:00
|
|
|
public getMentions(
|
|
|
|
limit?: number,
|
|
|
|
mentionRoles?: boolean,
|
|
|
|
mentionEveryone?: boolean,
|
|
|
|
): Promise<Collection<Snowflake, Message>>;
|
2022-04-08 12:00:31 +00:00
|
|
|
/**
|
|
|
|
* Nitro Status
|
|
|
|
* `0`: None
|
|
|
|
* `1`: Classic
|
|
|
|
* `2`: Boost
|
2022-05-11 13:19:04 +00:00
|
|
|
* @external https://discord.com/developers/docs/resources/user#user-object-premium-types
|
2022-04-08 12:00:31 +00:00
|
|
|
*/
|
2022-03-24 12:35:59 +00:00
|
|
|
public readonly nitroType: NitroType;
|
2022-04-16 12:01:05 +00:00
|
|
|
public readonly phoneNumber: string;
|
2022-03-24 12:35:59 +00:00
|
|
|
public readonly nsfwAllowed: boolean;
|
2022-04-16 12:01:05 +00:00
|
|
|
public readonly emailAddress: string;
|
2023-03-05 10:05:40 +00:00
|
|
|
public stopRinging(channel: ChannelResolvable): Promise<void>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
2022-10-26 12:38:09 +00:00
|
|
|
|
|
|
|
type NitroType = 'NONE' | 'NITRO_CLASSIC' | 'NITRO_BOOST' | 'NITRO_BASIC';
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class Options extends null {
|
|
|
|
private constructor();
|
|
|
|
public static defaultMakeCacheSettings: CacheWithLimitsOptions;
|
|
|
|
public static 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<Snowflake, InternalDiscordGatewayAdapterLibraryMethods>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export { Collection } from '@discordjs/collection';
|
|
|
|
|
|
|
|
export interface CollectorEventTypes<K, V, F extends unknown[] = []> {
|
|
|
|
collect: [V, ...F];
|
|
|
|
dispose: [V, ...F];
|
|
|
|
end: [collected: Collection<K, V>, reason: string];
|
|
|
|
}
|
|
|
|
|
|
|
|
export abstract class Collector<K, V, F extends unknown[] = []> extends EventEmitter {
|
|
|
|
protected constructor(client: Client, options?: CollectorOptions<[V, ...F]>);
|
|
|
|
private _timeout: NodeJS.Timeout | null;
|
|
|
|
private _idletimeout: NodeJS.Timeout | null;
|
|
|
|
|
|
|
|
public readonly client: Client;
|
|
|
|
public collected: Collection<K, V>;
|
|
|
|
public ended: boolean;
|
|
|
|
public abstract readonly endReason: string | null;
|
|
|
|
public filter: CollectorFilter<[V, ...F]>;
|
|
|
|
public readonly next: Promise<V>;
|
|
|
|
public options: CollectorOptions<[V, ...F]>;
|
|
|
|
public checkEnd(): boolean;
|
|
|
|
public handleCollect(...args: unknown[]): Promise<void>;
|
|
|
|
public handleDispose(...args: unknown[]): Promise<void>;
|
|
|
|
public stop(reason?: string): void;
|
|
|
|
public resetTimer(options?: CollectorResetTimerOptions): void;
|
|
|
|
public [Symbol.asyncIterator](): AsyncIterableIterator<V>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
|
|
|
|
protected listener: (...args: any[]) => void;
|
|
|
|
public abstract collect(...args: unknown[]): K | null | Promise<K | null>;
|
|
|
|
public abstract dispose(...args: unknown[]): K | null;
|
|
|
|
|
|
|
|
public on<EventKey extends keyof CollectorEventTypes<K, V, F>>(
|
|
|
|
event: EventKey,
|
|
|
|
listener: (...args: CollectorEventTypes<K, V, F>[EventKey]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public once<EventKey extends keyof CollectorEventTypes<K, V, F>>(
|
|
|
|
event: EventKey,
|
|
|
|
listener: (...args: CollectorEventTypes<K, V, F>[EventKey]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandInteractionOptionResolver<Cached extends CacheType = CacheType>
|
|
|
|
extends CommandInteractionOptionResolver<Cached> {
|
|
|
|
getSubcommand(required?: true): string;
|
|
|
|
getSubcommand(required: boolean): string | null;
|
|
|
|
getSubcommandGroup(required?: true): string;
|
|
|
|
getSubcommandGroup(required: boolean): string | null;
|
|
|
|
getBoolean(name: string, required: true): boolean;
|
|
|
|
getBoolean(name: string, required?: boolean): boolean | null;
|
|
|
|
getChannel(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['channel']>;
|
|
|
|
getChannel(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['channel']> | null;
|
|
|
|
getString(name: string, required: true): string;
|
|
|
|
getString(name: string, required?: boolean): string | null;
|
|
|
|
getInteger(name: string, required: true): number;
|
|
|
|
getInteger(name: string, required?: boolean): number | null;
|
|
|
|
getNumber(name: string, required: true): number;
|
|
|
|
getNumber(name: string, required?: boolean): number | null;
|
|
|
|
getUser(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['user']>;
|
|
|
|
getUser(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['user']> | null;
|
|
|
|
getMember(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['member']>;
|
|
|
|
getMember(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['member']> | null;
|
|
|
|
getRole(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['role']>;
|
|
|
|
getRole(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['role']> | null;
|
|
|
|
getMentionable(
|
|
|
|
name: string,
|
|
|
|
required: true,
|
|
|
|
): NonNullable<CommandInteractionOption<Cached>['member' | 'role' | 'user']>;
|
|
|
|
getMentionable(
|
|
|
|
name: string,
|
|
|
|
required?: boolean,
|
|
|
|
): NonNullable<CommandInteractionOption<Cached>['member' | 'role' | 'user']> | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class CommandInteraction<Cached extends CacheType = CacheType> extends BaseCommandInteraction<Cached> {
|
|
|
|
public options: Omit<CommandInteractionOptionResolver<Cached>, 'getMessage' | 'getFocused'>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is CommandInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is CommandInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is CommandInteraction<'raw'>;
|
|
|
|
public toString(): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class AutocompleteInteraction<Cached extends CacheType = CacheType> extends Interaction<Cached> {
|
|
|
|
public readonly command: ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public commandId: Snowflake;
|
|
|
|
public commandName: string;
|
|
|
|
public responded: boolean;
|
|
|
|
public options: Omit<CommandInteractionOptionResolver<Cached>, 'getMessage'>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is AutocompleteInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is AutocompleteInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is AutocompleteInteraction<'raw'>;
|
|
|
|
private transformOption(option: APIApplicationCommandOption): CommandInteractionOption;
|
2022-05-14 08:06:15 +00:00
|
|
|
public respond(options: ApplicationCommandOptionChoiceData[]): Promise<void>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class CommandInteractionOptionResolver<Cached extends CacheType = CacheType> {
|
|
|
|
private constructor(client: Client, options: CommandInteractionOption[], resolved: CommandInteractionResolvedData);
|
|
|
|
public readonly client: Client;
|
|
|
|
public readonly data: readonly CommandInteractionOption<Cached>[];
|
|
|
|
public readonly resolved: Readonly<CommandInteractionResolvedData<Cached>>;
|
|
|
|
private _group: string | null;
|
|
|
|
private _hoistedOptions: CommandInteractionOption<Cached>[];
|
|
|
|
private _subcommand: string | null;
|
|
|
|
private _getTypedOption(
|
|
|
|
name: string,
|
|
|
|
type: ApplicationCommandOptionType,
|
|
|
|
properties: (keyof ApplicationCommandOption)[],
|
|
|
|
required: true,
|
|
|
|
): CommandInteractionOption<Cached>;
|
|
|
|
private _getTypedOption(
|
|
|
|
name: string,
|
|
|
|
type: ApplicationCommandOptionType,
|
|
|
|
properties: (keyof ApplicationCommandOption)[],
|
|
|
|
required: boolean,
|
|
|
|
): CommandInteractionOption<Cached> | null;
|
|
|
|
|
|
|
|
public get(name: string, required: true): CommandInteractionOption<Cached>;
|
|
|
|
public get(name: string, required?: boolean): CommandInteractionOption<Cached> | 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): NonNullable<CommandInteractionOption<Cached>['channel']>;
|
|
|
|
public getChannel(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['channel']> | 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<CommandInteractionOption<Cached>['user']>;
|
|
|
|
public getUser(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['user']> | null;
|
|
|
|
public getMember(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['member']>;
|
|
|
|
public getMember(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['member']> | null;
|
|
|
|
public getRole(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['role']>;
|
|
|
|
public getRole(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['role']> | null;
|
|
|
|
public getMentionable(
|
|
|
|
name: string,
|
|
|
|
required: true,
|
|
|
|
): NonNullable<CommandInteractionOption<Cached>['member' | 'role' | 'user']>;
|
|
|
|
public getMentionable(
|
|
|
|
name: string,
|
|
|
|
required?: boolean,
|
|
|
|
): NonNullable<CommandInteractionOption<Cached>['member' | 'role' | 'user']> | null;
|
|
|
|
public getMessage(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['message']>;
|
|
|
|
public getMessage(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['message']> | null;
|
2022-06-17 05:48:45 +00:00
|
|
|
public getFocused(getFull: true): AutocompleteFocusedOption;
|
|
|
|
public getFocused(getFull?: boolean): string;
|
2022-05-14 08:06:15 +00:00
|
|
|
public getAttachment(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['attachment']>;
|
|
|
|
public getAttachment(
|
|
|
|
name: string,
|
|
|
|
required?: boolean,
|
|
|
|
): NonNullable<CommandInteractionOption<Cached>['attachment']> | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class ContextMenuInteraction<Cached extends CacheType = CacheType> extends BaseCommandInteraction<Cached> {
|
|
|
|
public options: Omit<
|
|
|
|
CommandInteractionOptionResolver<Cached>,
|
|
|
|
| 'getFocused'
|
|
|
|
| 'getMentionable'
|
|
|
|
| 'getRole'
|
|
|
|
| 'getNumber'
|
|
|
|
| 'getInteger'
|
|
|
|
| 'getString'
|
|
|
|
| 'getChannel'
|
|
|
|
| 'getBoolean'
|
|
|
|
| 'getSubcommandGroup'
|
|
|
|
| 'getSubcommand'
|
|
|
|
>;
|
|
|
|
public targetId: Snowflake;
|
|
|
|
public targetType: Exclude<ApplicationCommandType, 'CHAT_INPUT'>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is ContextMenuInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is ContextMenuInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is ContextMenuInteraction<'raw'>;
|
|
|
|
private resolveContextMenuOptions(data: APIApplicationCommandInteractionData): CommandInteractionOption<Cached>[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DataResolver extends null {
|
|
|
|
private constructor();
|
|
|
|
public static resolveBase64(data: Base64Resolvable): string;
|
|
|
|
public static resolveCode(data: string, regx: RegExp): string;
|
|
|
|
public static resolveFile(resource: BufferResolvable | Stream): Promise<Buffer | Stream>;
|
|
|
|
public static resolveFileAsBuffer(resource: BufferResolvable | Stream): Promise<Buffer>;
|
|
|
|
public static resolveImage(resource: BufferResolvable | Base64Resolvable): Promise<string | null>;
|
|
|
|
public static resolveInviteCode(data: InviteResolvable): string;
|
|
|
|
public static resolveGuildTemplateCode(data: GuildTemplateResolvable): string;
|
|
|
|
}
|
|
|
|
|
2022-11-04 11:40:19 +00:00
|
|
|
export interface Captcha {
|
|
|
|
captcha_key: string[];
|
|
|
|
captcha_service: string;
|
|
|
|
captcha_sitekey: string;
|
|
|
|
captcha_rqdata?: string;
|
|
|
|
captcha_rqtoken?: string;
|
|
|
|
}
|
2022-03-19 10:37:45 +00:00
|
|
|
export class DiscordAPIError extends Error {
|
|
|
|
private constructor(error: unknown, status: number, request: unknown);
|
|
|
|
private static flattenErrors(obj: unknown, key: string): string[];
|
2022-11-04 11:40:19 +00:00
|
|
|
public captcha?: Captcha;
|
2022-03-19 10:37:45 +00:00
|
|
|
public code: number;
|
|
|
|
public method: string;
|
|
|
|
public path: string;
|
|
|
|
public httpStatus: number;
|
|
|
|
public requestData: HTTPErrorData;
|
2023-02-14 16:46:04 +00:00
|
|
|
public retries: number;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2022-06-06 04:21:36 +00:00
|
|
|
export class DMChannel extends TextBasedChannelMixin(Channel, [
|
|
|
|
'bulkDelete',
|
|
|
|
'fetchWebhooks',
|
|
|
|
'createWebhook',
|
|
|
|
'setRateLimitPerUser',
|
|
|
|
'setNSFW',
|
|
|
|
]) {
|
2022-03-19 10:37:45 +00:00
|
|
|
private constructor(client: Client, data?: RawDMChannelData);
|
|
|
|
public recipient: User;
|
|
|
|
public type: 'DM';
|
2022-10-03 12:25:39 +00:00
|
|
|
public flags: Readonly<ChannelFlags>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetch(force?: boolean): Promise<this>;
|
2022-05-21 13:58:33 +00:00
|
|
|
public readonly voiceAdapterCreator: InternalDiscordGatewayAdapterCreator;
|
2022-10-24 16:29:09 +00:00
|
|
|
public call(options?: CallOptions): Promise<VoiceConnection>;
|
2022-08-14 10:16:51 +00:00
|
|
|
public sync(): undefined;
|
2022-05-21 13:58:33 +00:00
|
|
|
public readonly shard: WebSocketShard;
|
2022-08-14 10:16:51 +00:00
|
|
|
public readonly voiceUsers: Collection<Snowflake, User>;
|
|
|
|
public readonly voiceConnection?: VoiceConnection;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2022-10-24 16:29:09 +00:00
|
|
|
export interface CallOptions {
|
|
|
|
selfDeaf?: boolean;
|
|
|
|
selfMute?: boolean;
|
|
|
|
ring?: boolean;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class Emoji extends Base {
|
|
|
|
protected constructor(client: Client, emoji: RawEmojiData);
|
|
|
|
public animated: boolean | null;
|
|
|
|
public readonly createdAt: Date | null;
|
|
|
|
public readonly createdTimestamp: number | null;
|
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public id: Snowflake | null;
|
|
|
|
public name: string | null;
|
|
|
|
public readonly identifier: string;
|
|
|
|
public readonly url: string | null;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Guild extends AnonymousGuild {
|
|
|
|
private constructor(client: Client, data: RawGuildData);
|
|
|
|
private _sortedRoles(): Collection<Snowflake, Role>;
|
|
|
|
private _sortedChannels(channel: NonThreadGuildBasedChannel): Collection<Snowflake, NonThreadGuildBasedChannel>;
|
|
|
|
|
|
|
|
public readonly afkChannel: VoiceChannel | null;
|
2023-02-21 12:01:26 +00:00
|
|
|
public topEmojis(): Promise<Collection<number, Emoji>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public afkChannelId: Snowflake | null;
|
|
|
|
public afkTimeout: number;
|
|
|
|
public applicationId: Snowflake | null;
|
|
|
|
public approximateMemberCount: number | null;
|
|
|
|
public approximatePresenceCount: number | null;
|
2022-12-20 15:46:50 +00:00
|
|
|
public autoModerationRules: AutoModerationRuleManager;
|
2022-03-19 10:37:45 +00:00
|
|
|
public available: boolean;
|
|
|
|
public bans: GuildBanManager;
|
|
|
|
public channels: GuildChannelManager;
|
2022-03-25 15:57:21 +00:00
|
|
|
// public commands: GuildApplicationCommandManager;
|
2022-03-19 10:37:45 +00:00
|
|
|
public defaultMessageNotifications: DefaultMessageNotificationLevel | number;
|
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public discoverySplash: string | null;
|
|
|
|
public emojis: GuildEmojiManager;
|
|
|
|
public explicitContentFilter: ExplicitContentFilterLevel;
|
|
|
|
public invites: GuildInviteManager;
|
|
|
|
public readonly joinedAt: Date;
|
|
|
|
public joinedTimestamp: number;
|
|
|
|
public large: boolean;
|
|
|
|
public maximumMembers: number | null;
|
|
|
|
public maximumPresences: number | null;
|
2023-01-06 11:32:11 +00:00
|
|
|
public maxStageVideoChannelUsers: number | null;
|
2022-08-08 15:08:24 +00:00
|
|
|
public maxVideoChannelUsers: number | null;
|
2023-01-10 11:08:05 +00:00
|
|
|
/** @deprecated Use {@link GuildMemberManager.me} instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly me: GuildMember | null;
|
|
|
|
public memberCount: number;
|
|
|
|
public members: GuildMemberManager;
|
|
|
|
public mfaLevel: MFALevel;
|
|
|
|
public ownerId: Snowflake;
|
|
|
|
public preferredLocale: string;
|
|
|
|
public premiumSubscriptionCount: number | null;
|
|
|
|
public premiumProgressBarEnabled: boolean;
|
|
|
|
public premiumTier: PremiumTier;
|
|
|
|
public presences: PresenceManager;
|
2022-04-05 12:01:20 +00:00
|
|
|
public readonly disableDM: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly publicUpdatesChannel: TextChannel | null;
|
|
|
|
public publicUpdatesChannelId: Snowflake | null;
|
|
|
|
public roles: RoleManager;
|
|
|
|
public readonly rulesChannel: TextChannel | null;
|
|
|
|
public rulesChannelId: Snowflake | null;
|
2023-02-12 08:30:49 +00:00
|
|
|
public readonly safetyAlertsChannel: TextChannel | null;
|
|
|
|
public safetyAlertsChannelId: Snowflake | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public scheduledEvents: GuildScheduledEventManager;
|
|
|
|
public readonly shard: WebSocketShard;
|
|
|
|
public shardId: number;
|
|
|
|
public stageInstances: StageInstanceManager;
|
|
|
|
public stickers: GuildStickerManager;
|
|
|
|
public readonly systemChannel: TextChannel | null;
|
|
|
|
public systemChannelFlags: Readonly<SystemChannelFlags>;
|
|
|
|
public systemChannelId: Snowflake | null;
|
|
|
|
public vanityURLUses: number | null;
|
|
|
|
public readonly voiceAdapterCreator: InternalDiscordGatewayAdapterCreator;
|
|
|
|
public readonly voiceStates: VoiceStateManager;
|
2022-10-03 12:25:39 +00:00
|
|
|
public readonly widgetChannel: TextChannel | NewsChannel | VoiceBasedChannel | ForumChannel | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public widgetChannelId: Snowflake | null;
|
|
|
|
public widgetEnabled: boolean | null;
|
|
|
|
public readonly maximumBitrate: number;
|
|
|
|
public createTemplate(name: string, description?: string): Promise<GuildTemplate>;
|
2023-04-02 06:18:35 +00:00
|
|
|
public delete(mfaCode?: string): Promise<Guild>;
|
2022-08-03 12:08:32 +00:00
|
|
|
public read(): Promise<undefined>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public discoverySplashURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public edit(data: GuildEditData, reason?: string): Promise<Guild>;
|
|
|
|
public editWelcomeScreen(data: WelcomeScreenEditData): Promise<WelcomeScreen>;
|
|
|
|
public equals(guild: Guild): boolean;
|
|
|
|
public fetchAuditLogs<T extends GuildAuditLogsResolvable = 'ALL'>(
|
|
|
|
options?: GuildAuditLogsFetchOptions<T>,
|
|
|
|
): Promise<GuildAuditLogs<T>>;
|
2023-01-07 22:06:28 +00:00
|
|
|
public mute(mute: boolean, time: number | null): boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetchIntegrations(): Promise<Collection<Snowflake | string, Integration>>;
|
|
|
|
public fetchOwner(options?: BaseFetchOptions): Promise<GuildMember>;
|
|
|
|
public fetchPreview(): Promise<GuildPreview>;
|
|
|
|
public fetchTemplates(): Promise<Collection<GuildTemplate['code'], GuildTemplate>>;
|
|
|
|
public fetchVanityData(): Promise<Vanity>;
|
|
|
|
public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
|
|
|
|
public fetchWelcomeScreen(): Promise<WelcomeScreen>;
|
|
|
|
public fetchWidget(): Promise<Widget>;
|
|
|
|
public fetchWidgetSettings(): Promise<GuildWidgetSettings>;
|
2023-01-17 11:47:44 +00:00
|
|
|
public disableInvites(disabled?: boolean): Promise<Guild>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public leave(): Promise<Guild>;
|
|
|
|
public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise<Guild>;
|
|
|
|
public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>;
|
|
|
|
public setBanner(banner: BufferResolvable | Base64Resolvable | null, reason?: string): Promise<Guild>;
|
|
|
|
/** @deprecated Use {@link GuildChannelManager.setPositions} instead */
|
|
|
|
public setChannelPositions(channelPositions: readonly ChannelPosition[]): Promise<Guild>;
|
|
|
|
public setDefaultMessageNotifications(
|
2022-05-14 08:06:15 +00:00
|
|
|
defaultMessageNotifications: DefaultMessageNotificationLevel | number | null,
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string,
|
|
|
|
): Promise<Guild>;
|
|
|
|
public setDiscoverySplash(
|
|
|
|
discoverySplash: BufferResolvable | Base64Resolvable | null,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<Guild>;
|
|
|
|
public setExplicitContentFilter(
|
2022-05-14 08:06:15 +00:00
|
|
|
explicitContentFilter: ExplicitContentFilterLevel | number | null,
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string,
|
|
|
|
): Promise<Guild>;
|
|
|
|
public setIcon(icon: BufferResolvable | Base64Resolvable | null, reason?: string): Promise<Guild>;
|
|
|
|
public setName(name: string, reason?: string): Promise<Guild>;
|
|
|
|
public setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>;
|
2022-06-04 06:26:53 +00:00
|
|
|
public setPosition(position: number, type: 'FOLDER' | 'HOME', folderID?: number): Promise<Guild>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setPreferredLocale(preferredLocale: string, reason?: string): Promise<Guild>;
|
|
|
|
public setPublicUpdatesChannel(publicUpdatesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
|
|
|
/** @deprecated Use {@link RoleManager.setPositions} instead */
|
|
|
|
public setRolePositions(rolePositions: readonly RolePosition[]): Promise<Guild>;
|
|
|
|
public setRulesChannel(rulesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
2023-02-12 08:30:49 +00:00
|
|
|
public setSafetyAlertsChannel(safetyAlertsChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setSplash(splash: BufferResolvable | Base64Resolvable | null, reason?: string): Promise<Guild>;
|
|
|
|
public setSystemChannel(systemChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
|
|
|
public setSystemChannelFlags(systemChannelFlags: SystemChannelFlagsResolvable, reason?: string): Promise<Guild>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public setVerificationLevel(verificationLevel: VerificationLevel | number | null, reason?: string): Promise<Guild>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise<Guild>;
|
2022-04-16 10:44:43 +00:00
|
|
|
public setCommunity(
|
|
|
|
stats: boolean,
|
|
|
|
publicUpdatesChannel: TextChannelResolvable,
|
|
|
|
rulesChannel: TextChannelResolvable,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<Guild>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>;
|
2023-02-14 05:41:06 +00:00
|
|
|
public setVanityCode(code?: string): Promise<Vanity>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public toJSON(): unknown;
|
2023-04-02 06:18:35 +00:00
|
|
|
// Added
|
|
|
|
/** @deprecated */
|
|
|
|
public readonly clydeSupport: boolean;
|
|
|
|
/** @deprecated */
|
|
|
|
public enableClydeAI(enabled?: boolean): Promise<Guild>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildAuditLogs<T extends GuildAuditLogsResolvable = 'ALL'> {
|
|
|
|
private constructor(guild: Guild, data: RawGuildAuditLogData);
|
|
|
|
private webhooks: Collection<Snowflake, Webhook>;
|
|
|
|
private integrations: Collection<Snowflake | string, Integration>;
|
2022-12-20 15:46:50 +00:00
|
|
|
private autoModerationRules: Collection<Snowflake, AutoModerationRule>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
public entries: Collection<Snowflake, GuildAuditLogsEntry<T>>;
|
|
|
|
|
|
|
|
public static Actions: GuildAuditLogsActions;
|
|
|
|
public static Targets: GuildAuditLogsTargets;
|
|
|
|
public static Entry: typeof GuildAuditLogsEntry;
|
|
|
|
public static actionType(action: number): GuildAuditLogsActionType;
|
|
|
|
public static build(...args: unknown[]): Promise<GuildAuditLogs>;
|
|
|
|
public static targetType(target: number): GuildAuditLogsTarget;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildAuditLogsEntry<
|
|
|
|
TActionRaw extends GuildAuditLogsResolvable = 'ALL',
|
|
|
|
TAction = TActionRaw extends keyof GuildAuditLogsIds
|
2022-04-16 10:44:43 +00:00
|
|
|
? GuildAuditLogsIds[TActionRaw]
|
|
|
|
: TActionRaw extends null
|
|
|
|
? 'ALL'
|
|
|
|
: TActionRaw,
|
2022-03-19 10:37:45 +00:00
|
|
|
TActionType extends GuildAuditLogsActionType = TAction extends keyof GuildAuditLogsTypes
|
2022-04-16 10:44:43 +00:00
|
|
|
? GuildAuditLogsTypes[TAction][1]
|
|
|
|
: 'ALL',
|
2022-03-19 10:37:45 +00:00
|
|
|
TTargetType extends GuildAuditLogsTarget = TAction extends keyof GuildAuditLogsTypes
|
2022-04-16 10:44:43 +00:00
|
|
|
? GuildAuditLogsTypes[TAction][0]
|
|
|
|
: 'UNKNOWN',
|
|
|
|
> {
|
2023-02-12 08:52:03 +00:00
|
|
|
private constructor(guild: Guild, data: RawGuildAuditLogEntryData, logs?: GuildAuditLogs);
|
2022-03-19 10:37:45 +00:00
|
|
|
public action: TAction;
|
|
|
|
public actionType: TActionType;
|
2022-06-17 05:50:32 +00:00
|
|
|
public changes: AuditLogChange[];
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
2023-02-12 08:52:03 +00:00
|
|
|
public executorId: Snowflake | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public executor: User | null;
|
|
|
|
public extra: TAction extends keyof GuildAuditLogsEntryExtraField ? GuildAuditLogsEntryExtraField[TAction] : null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public reason: string | null;
|
2023-02-12 08:52:03 +00:00
|
|
|
public targetId: Snowflake | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public target: TTargetType extends keyof GuildAuditLogsEntryTargetField<TActionType>
|
|
|
|
? GuildAuditLogsEntryTargetField<TActionType>[TTargetType]
|
|
|
|
: Role | GuildEmoji | { id: Snowflake } | null;
|
|
|
|
public targetType: TTargetType;
|
|
|
|
public toJSON(): unknown;
|
2022-12-05 11:30:45 +00:00
|
|
|
public addIntegration(applicationId: Snowflake): Promise<boolean>;
|
2022-11-08 06:27:44 +00:00
|
|
|
public addBot(bot: UserResolvable | Snowflake, permissions?: PermissionResolvable): Promise<boolean>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildBan extends Base {
|
|
|
|
private constructor(client: Client, data: RawGuildBanData, guild: Guild);
|
|
|
|
public guild: Guild;
|
|
|
|
public user: User;
|
|
|
|
public readonly partial: boolean;
|
|
|
|
public reason?: string | null;
|
|
|
|
public fetch(force?: boolean): Promise<GuildBan>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export abstract class GuildChannel extends Channel {
|
|
|
|
public constructor(guild: Guild, data?: RawGuildChannelData, client?: Client, immediatePatch?: boolean);
|
|
|
|
private memberPermissions(member: GuildMember, checkAdmin: boolean): Readonly<Permissions>;
|
|
|
|
private rolePermissions(role: Role, checkAdmin: boolean): Readonly<Permissions>;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly calculatedPosition: number;
|
|
|
|
public readonly deletable: boolean;
|
|
|
|
public guild: Guild;
|
|
|
|
public guildId: Snowflake;
|
|
|
|
public readonly manageable: boolean;
|
|
|
|
public readonly members: Collection<Snowflake, GuildMember>;
|
|
|
|
public name: string;
|
|
|
|
public readonly parent: CategoryChannel | null;
|
|
|
|
public parentId: Snowflake | null;
|
|
|
|
public permissionOverwrites: PermissionOverwriteManager;
|
|
|
|
public readonly permissionsLocked: boolean | null;
|
|
|
|
public readonly position: number;
|
|
|
|
public rawPosition: number;
|
|
|
|
public type: Exclude<keyof typeof ChannelTypes, 'DM' | 'GROUP_DM' | 'UNKNOWN'>;
|
2022-10-03 12:25:39 +00:00
|
|
|
public flags: Readonly<ChannelFlags>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly viewable: boolean;
|
|
|
|
public clone(options?: GuildChannelCloneOptions): Promise<this>;
|
|
|
|
public delete(reason?: string): Promise<this>;
|
|
|
|
public edit(data: ChannelData, reason?: string): Promise<this>;
|
|
|
|
public equals(channel: GuildChannel): boolean;
|
|
|
|
public lockPermissions(): Promise<this>;
|
|
|
|
public permissionsFor(memberOrRole: GuildMember | Role, checkAdmin?: boolean): Readonly<Permissions>;
|
|
|
|
public permissionsFor(
|
|
|
|
memberOrRole: GuildMemberResolvable | RoleResolvable,
|
|
|
|
checkAdmin?: boolean,
|
|
|
|
): Readonly<Permissions> | null;
|
|
|
|
public setName(name: string, reason?: string): Promise<this>;
|
|
|
|
public setParent(channel: CategoryChannelResolvable | null, options?: SetParentOptions): Promise<this>;
|
|
|
|
public setPosition(position: number, options?: SetChannelPositionOptions): Promise<this>;
|
2022-06-17 05:52:53 +00:00
|
|
|
public isText(): this is GuildTextBasedChannel;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildEmoji extends BaseGuildEmoji {
|
|
|
|
private constructor(client: Client, data: RawGuildEmojiData, guild: Guild);
|
|
|
|
private _roles: Snowflake[];
|
|
|
|
|
|
|
|
public readonly deletable: boolean;
|
|
|
|
public guild: Guild;
|
|
|
|
public author: User | null;
|
|
|
|
public readonly roles: GuildEmojiRoleManager;
|
|
|
|
public readonly url: string;
|
|
|
|
public delete(reason?: string): Promise<GuildEmoji>;
|
|
|
|
public edit(data: GuildEmojiEditData, reason?: string): Promise<GuildEmoji>;
|
|
|
|
public equals(other: GuildEmoji | unknown): boolean;
|
|
|
|
public fetchAuthor(): Promise<User>;
|
|
|
|
public setName(name: string, reason?: string): Promise<GuildEmoji>;
|
|
|
|
}
|
|
|
|
|
2023-04-22 06:32:37 +00:00
|
|
|
export interface UserBadge {
|
|
|
|
name: string;
|
|
|
|
description: string;
|
|
|
|
icon: string;
|
|
|
|
link?: string;
|
|
|
|
iconURL(): string;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class GuildMember extends PartialTextBasedChannel(Base) {
|
|
|
|
private constructor(client: Client, data: RawGuildMemberData, guild: Guild);
|
2023-04-02 05:46:18 +00:00
|
|
|
private _roles: Snowflake[];
|
2022-03-19 10:37:45 +00:00
|
|
|
public avatar: string | null;
|
|
|
|
public readonly bannable: boolean;
|
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public readonly displayColor: number;
|
|
|
|
public readonly displayHexColor: HexColorString;
|
|
|
|
public readonly displayName: string;
|
2023-02-19 05:07:03 +00:00
|
|
|
public flags: Readonly<GuildMemberFlags>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public guild: Guild;
|
|
|
|
public readonly id: Snowflake;
|
|
|
|
public pending: boolean;
|
|
|
|
public readonly communicationDisabledUntil: Date | null;
|
|
|
|
public communicationDisabledUntilTimestamp: number | null;
|
|
|
|
public readonly joinedAt: Date | null;
|
|
|
|
public joinedTimestamp: number | null;
|
|
|
|
public readonly kickable: boolean;
|
|
|
|
public readonly manageable: boolean;
|
|
|
|
public readonly moderatable: boolean;
|
|
|
|
public nickname: string | null;
|
|
|
|
public readonly partial: false;
|
|
|
|
public readonly permissions: Readonly<Permissions>;
|
|
|
|
public readonly premiumSince: Date | null;
|
|
|
|
public premiumSinceTimestamp: number | null;
|
|
|
|
public readonly presence: Presence | null;
|
|
|
|
public readonly roles: GuildMemberRoleManager;
|
|
|
|
public user: User;
|
|
|
|
public readonly voice: VoiceState;
|
2022-10-26 12:38:09 +00:00
|
|
|
public themeColors?: [number, number];
|
|
|
|
public readonly hexThemeColor: [string, string] | null;
|
2023-04-22 06:32:37 +00:00
|
|
|
public badges: UserBadge[] | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public avatarURL(options?: ImageURLOptions): string | null;
|
|
|
|
public ban(options?: BanOptions): Promise<GuildMember>;
|
|
|
|
public disableCommunicationUntil(timeout: DateResolvable | null, reason?: string): Promise<GuildMember>;
|
|
|
|
public timeout(timeout: number | null, reason?: string): Promise<GuildMember>;
|
|
|
|
public fetch(force?: boolean): Promise<GuildMember>;
|
|
|
|
public createDM(force?: boolean): Promise<DMChannel>;
|
|
|
|
public deleteDM(): Promise<DMChannel>;
|
|
|
|
public displayAvatarURL(options?: ImageURLOptions): string;
|
|
|
|
public edit(data: GuildMemberEditData, reason?: string): Promise<GuildMember>;
|
2022-03-24 10:55:32 +00:00
|
|
|
public isCommunicationDisabled(): this is GuildMember & {
|
|
|
|
communicationDisabledUntilTimestamp: number;
|
|
|
|
readonly communicationDisabledUntil: Date;
|
|
|
|
};
|
2022-03-19 10:37:45 +00:00
|
|
|
public kick(reason?: string): Promise<GuildMember>;
|
|
|
|
public permissionsIn(channel: GuildChannelResolvable): Readonly<Permissions>;
|
|
|
|
public setNickname(nickname: string | null, reason?: string): Promise<GuildMember>;
|
2023-02-19 05:07:03 +00:00
|
|
|
public setFlags(flags: GuildMemberFlagsResolvable): Promise<GuildMember>;
|
2022-08-04 12:26:16 +00:00
|
|
|
public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise<GuildMember>;
|
|
|
|
public setBanner(banner: BufferResolvable | Base64Resolvable | null): Promise<GuildMember>;
|
|
|
|
public setAboutMe(bio: string | null): Promise<GuildMember>;
|
2022-10-26 12:38:09 +00:00
|
|
|
public getProfile(): Promise<User>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): MemberMention;
|
|
|
|
public valueOf(): string;
|
2022-10-26 15:34:09 +00:00
|
|
|
public setThemeColors(primary?: ColorResolvable, accent?: ColorResolvable): GuildMember;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2023-02-19 05:07:03 +00:00
|
|
|
export class GuildMemberFlags extends BitField<GuildMemberFlagsString> {
|
|
|
|
public static FLAGS: Record<GuildMemberFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<GuildMemberFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class GuildPreview extends Base {
|
|
|
|
private constructor(client: Client, data: RawGuildPreviewData);
|
|
|
|
public approximateMemberCount: number;
|
|
|
|
public approximatePresenceCount: number;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public description: string | null;
|
|
|
|
public discoverySplash: string | null;
|
|
|
|
public emojis: Collection<Snowflake, GuildPreviewEmoji>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public stickers: Collection<Snowflake, Sticker>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public features: GuildFeatures[];
|
|
|
|
public icon: string | null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string;
|
|
|
|
public splash: string | null;
|
|
|
|
public discoverySplashURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public iconURL(options?: ImageURLOptions): string | null;
|
|
|
|
public splashURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public fetch(): Promise<GuildPreview>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildScheduledEvent<S extends GuildScheduledEventStatus = GuildScheduledEventStatus> 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;
|
|
|
|
public userCount: number | null;
|
|
|
|
public creator: User | null;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly scheduledStartAt: Date;
|
|
|
|
public readonly scheduledEndAt: Date | null;
|
|
|
|
public readonly channel: VoiceChannel | StageChannel | null;
|
|
|
|
public readonly guild: Guild | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
public readonly image: string | null;
|
|
|
|
public coverImageURL(options?: StaticImageURLOptions): string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public createInviteURL(options?: CreateGuildScheduledEventInviteURLOptions): Promise<string>;
|
|
|
|
public edit<T extends GuildScheduledEventSetStatusArg<S>>(
|
|
|
|
options: GuildScheduledEventEditOptions<S, T>,
|
|
|
|
): Promise<GuildScheduledEvent<T>>;
|
|
|
|
public delete(): Promise<GuildScheduledEvent<S>>;
|
|
|
|
public setName(name: string, reason?: string): Promise<GuildScheduledEvent<S>>;
|
|
|
|
public setScheduledStartTime(scheduledStartTime: DateResolvable, reason?: string): Promise<GuildScheduledEvent<S>>;
|
|
|
|
public setScheduledEndTime(scheduledEndTime: DateResolvable, reason?: string): Promise<GuildScheduledEvent<S>>;
|
|
|
|
public setDescription(description: string, reason?: string): Promise<GuildScheduledEvent<S>>;
|
|
|
|
public setStatus<T extends GuildScheduledEventSetStatusArg<S>>(
|
|
|
|
status: T,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<GuildScheduledEvent<T>>;
|
|
|
|
public setLocation(location: string, reason?: string): Promise<GuildScheduledEvent<S>>;
|
|
|
|
public fetchSubscribers<T extends FetchGuildScheduledEventSubscribersOptions>(
|
|
|
|
options?: T,
|
|
|
|
): Promise<GuildScheduledEventManagerFetchSubscribersResult<T>>;
|
|
|
|
public toString(): string;
|
|
|
|
public isActive(): this is GuildScheduledEvent<'ACTIVE'>;
|
|
|
|
public isCanceled(): this is GuildScheduledEvent<'CANCELED'>;
|
|
|
|
public isCompleted(): this is GuildScheduledEvent<'COMPLETED'>;
|
|
|
|
public isScheduled(): this is GuildScheduledEvent<'SCHEDULED'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildTemplate extends Base {
|
|
|
|
private constructor(client: Client, data: RawGuildTemplateData);
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public readonly updatedTimestamp: number;
|
|
|
|
public readonly url: string;
|
|
|
|
public code: string;
|
|
|
|
public name: string;
|
|
|
|
public description: string | null;
|
|
|
|
public usageCount: number;
|
|
|
|
public creator: User;
|
|
|
|
public creatorId: Snowflake;
|
|
|
|
public createdAt: Date;
|
|
|
|
public updatedAt: Date;
|
|
|
|
public guild: Guild | null;
|
|
|
|
public guildId: Snowflake;
|
|
|
|
public serializedGuild: APITemplateSerializedSourceGuild;
|
|
|
|
public unSynced: boolean | null;
|
|
|
|
public createGuild(name: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>;
|
|
|
|
public delete(): Promise<GuildTemplate>;
|
|
|
|
public edit(options?: EditGuildTemplateOptions): Promise<GuildTemplate>;
|
|
|
|
public sync(): Promise<GuildTemplate>;
|
|
|
|
public static GUILD_TEMPLATES_PATTERN: RegExp;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildPreviewEmoji extends BaseGuildEmoji {
|
|
|
|
private constructor(client: Client, data: RawGuildEmojiData, guild: GuildPreview);
|
|
|
|
public guild: GuildPreview;
|
|
|
|
public roles: Snowflake[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export class HTTPError extends Error {
|
|
|
|
private constructor(message: string, name: string, code: number, request: unknown);
|
|
|
|
public code: number;
|
|
|
|
public method: string;
|
|
|
|
public name: string;
|
|
|
|
public path: string;
|
|
|
|
public requestData: HTTPErrorData;
|
|
|
|
}
|
|
|
|
|
|
|
|
// tslint:disable-next-line:no-empty-interface - Merge RateLimitData into RateLimitError to not have to type it again
|
2022-04-16 10:44:43 +00:00
|
|
|
export interface RateLimitError extends RateLimitData {}
|
2022-03-19 10:37:45 +00:00
|
|
|
export class RateLimitError extends Error {
|
|
|
|
private constructor(data: RateLimitData);
|
|
|
|
public name: 'RateLimitError';
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Integration extends Base {
|
|
|
|
private constructor(client: Client, data: RawIntegrationData, guild: Guild);
|
|
|
|
public account: IntegrationAccount;
|
|
|
|
public application: IntegrationApplication | null;
|
|
|
|
public enabled: boolean;
|
|
|
|
public expireBehavior: number | undefined;
|
|
|
|
public expireGracePeriod: number | undefined;
|
|
|
|
public guild: Guild;
|
|
|
|
public id: Snowflake | string;
|
|
|
|
public name: string;
|
|
|
|
public role: Role | undefined;
|
|
|
|
public enableEmoticons: boolean | null;
|
|
|
|
public readonly roles: Collection<Snowflake, Role>;
|
|
|
|
public syncedAt: number | undefined;
|
|
|
|
public syncing: boolean | undefined;
|
|
|
|
public type: IntegrationType;
|
|
|
|
public user: User | null;
|
|
|
|
public subscriberCount: number | null;
|
|
|
|
public revoked: boolean | null;
|
|
|
|
public delete(reason?: string): Promise<Integration>;
|
|
|
|
}
|
|
|
|
|
|
|
|
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[];
|
2022-05-14 08:06:15 +00:00
|
|
|
/** @deprecated This property is no longer being sent by the API. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public summary: string | null;
|
|
|
|
public hook: boolean | null;
|
|
|
|
public cover: string | null;
|
|
|
|
public verifyKey: string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Intents extends BitField<IntentsString> {
|
|
|
|
public static FLAGS: Record<IntentsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<IntentsString, number>): number;
|
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type CacheType = 'cached' | 'raw' | undefined;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type CacheTypeReducer<
|
|
|
|
State extends CacheType,
|
|
|
|
CachedType,
|
|
|
|
RawType = CachedType,
|
|
|
|
PresentType = CachedType | RawType,
|
|
|
|
Fallback = PresentType | null,
|
2022-04-16 10:44:43 +00:00
|
|
|
> = [State] extends ['cached']
|
2022-03-19 10:37:45 +00:00
|
|
|
? CachedType
|
|
|
|
: [State] extends ['raw']
|
|
|
|
? RawType
|
2022-05-14 08:06:15 +00:00
|
|
|
: [State] extends ['raw' | 'cached']
|
2022-03-19 10:37:45 +00:00
|
|
|
? PresentType
|
|
|
|
: Fallback;
|
|
|
|
|
|
|
|
export class Interaction<Cached extends CacheType = CacheType> 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 readonly channel: CacheTypeReducer<
|
|
|
|
Cached,
|
|
|
|
GuildTextBasedChannel | null,
|
|
|
|
GuildTextBasedChannel | null,
|
|
|
|
GuildTextBasedChannel | null,
|
|
|
|
TextBasedChannel | null
|
|
|
|
>;
|
|
|
|
public channelId: Snowflake | null;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public readonly guild: CacheTypeReducer<Cached, Guild, null>;
|
|
|
|
public guildId: CacheTypeReducer<Cached, Snowflake>;
|
|
|
|
public id: Snowflake;
|
|
|
|
public member: CacheTypeReducer<Cached, GuildMember, APIInteractionGuildMember>;
|
|
|
|
public readonly token: string;
|
|
|
|
public type: InteractionType;
|
|
|
|
public user: User;
|
|
|
|
public version: number;
|
2022-07-01 03:02:36 +00:00
|
|
|
public appPermissions: Readonly<Permissions> | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public memberPermissions: CacheTypeReducer<Cached, Readonly<Permissions>>;
|
2022-03-24 10:55:32 +00:00
|
|
|
public locale: string;
|
|
|
|
public guildLocale: CacheTypeReducer<Cached, string, string, string>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is Interaction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is Interaction<'cached'>;
|
|
|
|
public inRawGuild(): this is Interaction<'raw'>;
|
|
|
|
public isApplicationCommand(): this is BaseCommandInteraction<Cached>;
|
|
|
|
public isButton(): this is ButtonInteraction<Cached>;
|
|
|
|
public isCommand(): this is CommandInteraction<Cached>;
|
|
|
|
public isAutocomplete(): this is AutocompleteInteraction<Cached>;
|
|
|
|
public isContextMenu(): this is ContextMenuInteraction<Cached>;
|
|
|
|
public isUserContextMenu(): this is UserContextMenuInteraction<Cached>;
|
|
|
|
public isMessageContextMenu(): this is MessageContextMenuInteraction<Cached>;
|
|
|
|
public isMessageComponent(): this is MessageComponentInteraction<Cached>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public isModalSubmit(): this is ModalSubmitInteraction<Cached>;
|
2023-02-28 06:42:35 +00:00
|
|
|
public isAnySelectMenu(): this is SelectMenuInteraction<Cached>;
|
|
|
|
/** @deprecated Use {@link Interaction#isStringSelect()} instead */
|
|
|
|
public isSelectMenu(): this is StringSelectInteraction<Cached>;
|
|
|
|
public isStringSelect(): this is StringSelectInteraction<Cached>;
|
|
|
|
public isUserSelect(): this is UserSelectInteraction<Cached>;
|
|
|
|
public isMentionableSelect(): this is MentionableSelectInteraction<Cached>;
|
|
|
|
public isRoleSelect(): this is RoleSelectInteraction<Cached>;
|
|
|
|
public isChannelSelect(): this is ChannelSelectInteraction<Cached>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public isRepliable(): this is this & InteractionResponseFields<Cached>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class InteractionCollector<T extends Interaction> extends Collector<Snowflake, T> {
|
|
|
|
public constructor(client: Client, options?: InteractionCollectorOptions<T>);
|
|
|
|
private _handleMessageDeletion(message: Message): void;
|
|
|
|
private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void;
|
|
|
|
private _handleGuildDeletion(guild: Guild): void;
|
|
|
|
|
|
|
|
public channelId: Snowflake | null;
|
|
|
|
public componentType: MessageComponentType | null;
|
|
|
|
public readonly endReason: string | null;
|
|
|
|
public guildId: Snowflake | null;
|
|
|
|
public interactionType: InteractionType | null;
|
|
|
|
public messageId: Snowflake | null;
|
|
|
|
public options: InteractionCollectorOptions<T>;
|
|
|
|
public total: number;
|
|
|
|
public users: Collection<Snowflake, User>;
|
|
|
|
|
|
|
|
public collect(interaction: Interaction): Snowflake;
|
|
|
|
public empty(): void;
|
|
|
|
public dispose(interaction: Interaction): Snowflake;
|
|
|
|
public on(event: 'collect' | 'dispose', listener: (interaction: T) => Awaitable<void>): this;
|
|
|
|
public on(event: 'end', listener: (collected: Collection<Snowflake, T>, reason: string) => Awaitable<void>): this;
|
|
|
|
public on(event: string, listener: (...args: any[]) => Awaitable<void>): this;
|
|
|
|
|
|
|
|
public once(event: 'collect' | 'dispose', listener: (interaction: T) => Awaitable<void>): this;
|
|
|
|
public once(event: 'end', listener: (collected: Collection<Snowflake, T>, reason: string) => Awaitable<void>): this;
|
|
|
|
public once(event: string, listener: (...args: any[]) => Awaitable<void>): this;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class InteractionWebhook extends PartialWebhookMixin() {
|
|
|
|
public constructor(client: Client, id: Snowflake, token: string);
|
|
|
|
public token: string;
|
|
|
|
public send(options: string | MessagePayload | InteractionReplyOptions): Promise<Message | APIMessage>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Invite extends Base {
|
|
|
|
private constructor(client: Client, data: RawInviteData);
|
|
|
|
public channel: NonThreadGuildBasedChannel | PartialGroupDMChannel;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public code: string;
|
|
|
|
public readonly deletable: boolean;
|
|
|
|
public readonly createdAt: Date | null;
|
|
|
|
public createdTimestamp: number | null;
|
|
|
|
public readonly expiresAt: Date | null;
|
|
|
|
public readonly expiresTimestamp: number | null;
|
|
|
|
public guild: InviteGuild | Guild | null;
|
|
|
|
public 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 readonly url: string;
|
|
|
|
public uses: number | null;
|
|
|
|
public delete(reason?: string): Promise<Invite>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): string;
|
2022-12-05 11:30:45 +00:00
|
|
|
public acceptInvite(autoVerify?: boolean): Promise<Guild>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public static INVITES_PATTERN: RegExp;
|
|
|
|
public stageInstance: InviteStageInstance | null;
|
|
|
|
public guildScheduledEvent: GuildScheduledEvent | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class InviteStageInstance extends Base {
|
|
|
|
private constructor(client: Client, data: RawInviteStageInstance, channelId: Snowflake, guildId: Snowflake);
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public guildId: Snowflake;
|
|
|
|
public members: Collection<Snowflake, GuildMember>;
|
|
|
|
public topic: string;
|
|
|
|
public participantCount: number;
|
|
|
|
public speakerCount: number;
|
|
|
|
public readonly channel: StageChannel | null;
|
|
|
|
public readonly guild: Guild | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class InviteGuild extends AnonymousGuild {
|
|
|
|
private constructor(client: Client, data: RawInviteGuildData);
|
|
|
|
public welcomeScreen: WelcomeScreen | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class LimitedCollection<K, V> extends Collection<K, V> {
|
|
|
|
public constructor(options?: LimitedCollectionOptions<K, V>, iterable?: Iterable<readonly [K, V]>);
|
|
|
|
public maxSize: number;
|
|
|
|
public keepOverLimit: ((value: V, key: K, collection: this) => boolean) | null;
|
|
|
|
/** @deprecated Use Global Sweepers instead */
|
|
|
|
public interval: NodeJS.Timeout | null;
|
|
|
|
/** @deprecated Use Global Sweepers instead */
|
|
|
|
public sweepFilter: SweepFilter<K, V> | null;
|
|
|
|
|
|
|
|
/** @deprecated Use `Sweepers.filterByLifetime` instead */
|
|
|
|
public static filterByLifetime<K, V>(options?: LifetimeFilterOptions<K, V>): SweepFilter<K, V>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageCollectorOptionsParams<T extends MessageComponentTypeResolvable, Cached extends boolean = boolean> =
|
|
|
|
| {
|
2022-04-16 10:44:43 +00:00
|
|
|
componentType?: T;
|
|
|
|
} & MessageComponentCollectorOptions<MappedInteractionTypes<Cached>[T]>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type MessageChannelCollectorOptionsParams<
|
|
|
|
T extends MessageComponentTypeResolvable,
|
|
|
|
Cached extends boolean = boolean,
|
2022-04-16 10:44:43 +00:00
|
|
|
> =
|
2022-03-19 10:37:45 +00:00
|
|
|
| {
|
2022-04-16 10:44:43 +00:00
|
|
|
componentType?: T;
|
|
|
|
} & MessageChannelComponentCollectorOptions<MappedInteractionTypes<Cached>[T]>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type AwaitMessageCollectorOptionsParams<
|
|
|
|
T extends MessageComponentTypeResolvable,
|
|
|
|
Cached extends boolean = boolean,
|
2022-04-16 10:44:43 +00:00
|
|
|
> =
|
2022-03-19 10:37:45 +00:00
|
|
|
| { componentType?: T } & Pick<
|
2022-04-16 10:44:43 +00:00
|
|
|
InteractionCollectorOptions<MappedInteractionTypes<Cached>[T]>,
|
|
|
|
keyof AwaitMessageComponentOptions<any>
|
|
|
|
>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface StringMappedInteractionTypes<Cached extends CacheType = CacheType> {
|
|
|
|
BUTTON: ButtonInteraction<Cached>;
|
2023-02-28 06:42:35 +00:00
|
|
|
/** @deprecated */
|
|
|
|
SELECT_MENU: SelectMenuInteraction<Cached>;
|
2022-12-18 06:17:48 +00:00
|
|
|
STRING_SELECT: SelectMenuInteraction<Cached>;
|
2022-11-06 05:05:18 +00:00
|
|
|
USER_SELECT: SelectMenuInteraction<Cached>;
|
|
|
|
ROLE_SELECT: SelectMenuInteraction<Cached>;
|
|
|
|
MENTIONABLE_SELECT: SelectMenuInteraction<Cached>;
|
|
|
|
CHANNEL_SELECT: SelectMenuInteraction<Cached>;
|
2023-02-28 06:42:35 +00:00
|
|
|
ACTION_ROW: MessageComponentInteraction<Cached>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type WrapBooleanCache<T extends boolean> = If<T, 'cached', CacheType>;
|
|
|
|
|
|
|
|
export type MappedInteractionTypes<Cached extends boolean = boolean> = EnumValueMapped<
|
|
|
|
typeof MessageComponentTypes,
|
|
|
|
{
|
|
|
|
BUTTON: ButtonInteraction<WrapBooleanCache<Cached>>;
|
2023-02-28 06:42:35 +00:00
|
|
|
/** @deprecated */
|
|
|
|
SELECT_MENU: StringSelectInteraction<WrapBooleanCache<Cached>>;
|
|
|
|
STRING_SELECT: StringSelectInteraction<WrapBooleanCache<Cached>>;
|
|
|
|
USER_SELECT: UserSelectInteraction<WrapBooleanCache<Cached>>;
|
|
|
|
ROLE_SELECT: RoleSelectInteraction<WrapBooleanCache<Cached>>;
|
|
|
|
MENTIONABLE_SELECT: MentionableSelectInteraction<WrapBooleanCache<Cached>>;
|
|
|
|
CHANNEL_SELECT: ChannelSelectInteraction<WrapBooleanCache<Cached>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
ACTION_ROW: MessageComponentInteraction<WrapBooleanCache<Cached>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
TEXT_INPUT: ModalSubmitInteraction<WrapBooleanCache<Cached>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
>;
|
|
|
|
|
|
|
|
export class Message<Cached extends boolean = boolean> extends Base {
|
|
|
|
private readonly _cacheType: Cached;
|
|
|
|
private constructor(client: Client, data: RawMessageData);
|
|
|
|
private _patch(data: RawPartialMessageData | RawMessageData): void;
|
|
|
|
|
|
|
|
public activity: MessageActivity | null;
|
|
|
|
public applicationId: Snowflake | null;
|
|
|
|
public attachments: Collection<Snowflake, MessageAttachment>;
|
|
|
|
public author: User;
|
2022-11-26 15:17:33 +00:00
|
|
|
public readonly bulkDeletable: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly channel: If<Cached, GuildTextBasedChannel, TextBasedChannel>;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public readonly cleanContent: string;
|
|
|
|
public components: MessageActionRow[];
|
|
|
|
public content: string;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public createdTimestamp: number;
|
|
|
|
public readonly crosspostable: boolean;
|
|
|
|
public readonly deletable: boolean;
|
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public readonly editable: boolean;
|
|
|
|
public readonly editedAt: Date | null;
|
|
|
|
public editedTimestamp: number | null;
|
|
|
|
public embeds: MessageEmbed[];
|
|
|
|
public groupActivityApplication: ClientApplication | null;
|
|
|
|
public guildId: If<Cached, Snowflake>;
|
|
|
|
public readonly guild: If<Cached, Guild>;
|
|
|
|
public readonly hasThread: boolean;
|
|
|
|
public id: Snowflake;
|
|
|
|
public interaction: MessageInteraction | null;
|
|
|
|
public readonly member: GuildMember | null;
|
|
|
|
public mentions: MessageMentions;
|
|
|
|
public nonce: string | number | null;
|
|
|
|
public readonly partial: false;
|
|
|
|
public readonly pinnable: boolean;
|
|
|
|
public pinned: boolean;
|
|
|
|
public reactions: ReactionManager;
|
|
|
|
public stickers: Collection<Snowflake, Sticker>;
|
|
|
|
public system: boolean;
|
|
|
|
public readonly thread: ThreadChannel | null;
|
|
|
|
public tts: boolean;
|
|
|
|
public type: MessageType;
|
|
|
|
public readonly url: string;
|
|
|
|
public webhookId: Snowflake | null;
|
|
|
|
public flags: Readonly<MessageFlags>;
|
|
|
|
public reference: MessageReference | null;
|
2022-10-03 12:25:39 +00:00
|
|
|
public position: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public awaitMessageComponent<T extends MessageComponentTypeResolvable = 'ACTION_ROW'>(
|
|
|
|
options?: AwaitMessageCollectorOptionsParams<T, Cached>,
|
|
|
|
): Promise<MappedInteractionTypes<Cached>[T]>;
|
|
|
|
public awaitReactions(options?: AwaitReactionsOptions): Promise<Collection<Snowflake | string, MessageReaction>>;
|
|
|
|
public createReactionCollector(options?: ReactionCollectorOptions): ReactionCollector;
|
|
|
|
public createMessageComponentCollector<T extends MessageComponentTypeResolvable = 'ACTION_ROW'>(
|
|
|
|
options?: MessageCollectorOptionsParams<T, Cached>,
|
|
|
|
): InteractionCollector<MappedInteractionTypes<Cached>[T]>;
|
|
|
|
public delete(): Promise<Message>;
|
|
|
|
public edit(content: string | MessageEditOptions | MessagePayload): Promise<Message>;
|
|
|
|
public equals(message: Message, rawData: unknown): boolean;
|
|
|
|
public fetchReference(): Promise<Message>;
|
|
|
|
public fetchWebhook(): Promise<Webhook>;
|
|
|
|
public crosspost(): Promise<Message>;
|
|
|
|
public fetch(force?: boolean): Promise<Message>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public pin(reason?: string): Promise<Message>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public react(emoji: EmojiIdentifierResolvable): Promise<MessageReaction>;
|
|
|
|
public removeAttachments(): Promise<Message>;
|
|
|
|
public reply(options: string | MessagePayload | ReplyMessageOptions): Promise<Message>;
|
|
|
|
public resolveComponent(customId: string): MessageActionRowComponent | null;
|
|
|
|
public startThread(options: StartThreadOptions): Promise<ThreadChannel>;
|
|
|
|
public suppressEmbeds(suppress?: boolean): Promise<Message>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): string;
|
2022-05-14 08:06:15 +00:00
|
|
|
public unpin(reason?: string): Promise<Message>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inGuild(): this is Message<true> & this;
|
2022-03-27 12:05:43 +00:00
|
|
|
// Added
|
2022-04-29 05:35:28 +00:00
|
|
|
public markUnread(): Promise<boolean>;
|
2022-08-03 12:34:58 +00:00
|
|
|
public markRead(): Promise<boolean>;
|
2022-12-02 11:29:57 +00:00
|
|
|
public clickButton(button?: MessageButton | MessageButtonLocation | string): Promise<InteractionResponse>;
|
2022-12-03 18:47:48 +00:00
|
|
|
public selectMenu(menuID: MessageSelectMenu | Snowflake | number, options: any[]): Promise<InteractionResponse>;
|
2022-12-03 18:13:19 +00:00
|
|
|
public selectMenu(options: any[]): Promise<InteractionResponse>;
|
2022-10-09 12:37:04 +00:00
|
|
|
public contextMenu(botID: Snowflake, commandName: string): Promise<InteractionResponse>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export class MessageActionRow<
|
|
|
|
T extends MessageActionRowComponent | ModalActionRowComponent = MessageActionRowComponent,
|
|
|
|
U = T extends ModalActionRowComponent ? ModalActionRowComponentResolvable : MessageActionRowComponentResolvable,
|
|
|
|
V = T extends ModalActionRowComponent
|
|
|
|
? APIActionRowComponent<APIModalActionRowComponent>
|
|
|
|
: APIActionRowComponent<APIMessageActionRowComponent>,
|
|
|
|
> extends BaseMessageComponent {
|
2022-09-09 16:44:45 +00:00
|
|
|
// @ts-ignore (TS:2344, Caused by TypeScript 4.8)
|
|
|
|
// Fixed in DiscordJS >= 14.x / DiscordApiTypes >= 0.37.x, ignoring the type error here.
|
2022-05-14 08:06:15 +00:00
|
|
|
public constructor(data?: MessageActionRow<T> | MessageActionRowOptions<U> | V);
|
2022-03-19 10:37:45 +00:00
|
|
|
public type: 'ACTION_ROW';
|
2022-05-14 08:06:15 +00:00
|
|
|
public components: T[];
|
|
|
|
public addComponents(...components: U[] | U[][]): this;
|
|
|
|
public setComponents(...components: U[] | U[][]): this;
|
|
|
|
public spliceComponents(index: number, deleteCount: number, ...components: U[] | U[][]): this;
|
|
|
|
public toJSON(): V;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageAttachment {
|
|
|
|
public constructor(attachment: BufferResolvable | Stream, name?: string, data?: RawMessageAttachmentData);
|
|
|
|
|
|
|
|
public attachment: BufferResolvable | Stream;
|
|
|
|
public contentType: string | null;
|
|
|
|
public description: string | null;
|
2023-04-25 11:18:55 +00:00
|
|
|
public duration: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public ephemeral: boolean;
|
|
|
|
public height: number | null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string | null;
|
|
|
|
public proxyURL: string;
|
|
|
|
public size: number;
|
|
|
|
public readonly spoiler: boolean;
|
|
|
|
public url: string;
|
2023-04-25 11:18:55 +00:00
|
|
|
public waveform: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public width: number | null;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2022-07-12 12:30:18 +00:00
|
|
|
export interface InteractionResponseBody {
|
|
|
|
id: Snowflake;
|
|
|
|
nonce: Snowflake;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class MessageButton extends BaseMessageComponent {
|
|
|
|
public constructor(data?: MessageButton | MessageButtonOptions | APIButtonComponent);
|
|
|
|
public customId: string | null;
|
|
|
|
public disabled: boolean;
|
|
|
|
public emoji: APIPartialEmoji | null;
|
|
|
|
public label: string | null;
|
|
|
|
public style: MessageButtonStyle | null;
|
|
|
|
public type: 'BUTTON';
|
|
|
|
public url: string | null;
|
|
|
|
public setCustomId(customId: string): this;
|
|
|
|
public setDisabled(disabled?: boolean): this;
|
|
|
|
public setEmoji(emoji: EmojiIdentifierResolvable): this;
|
|
|
|
public setLabel(label: string): this;
|
|
|
|
public setStyle(style: MessageButtonStyleResolvable): this;
|
|
|
|
public setURL(url: string): this;
|
|
|
|
public toJSON(): APIButtonComponent;
|
2022-10-09 12:37:04 +00:00
|
|
|
public click(message: Message): Promise<InteractionResponse>;
|
2022-03-19 10:37:45 +00:00
|
|
|
private static resolveStyle(style: MessageButtonStyleResolvable): MessageButtonStyle;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageCollector extends Collector<Snowflake, Message> {
|
|
|
|
public constructor(channel: TextBasedChannel, options?: MessageCollectorOptions);
|
|
|
|
private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void;
|
|
|
|
private _handleGuildDeletion(guild: Guild): void;
|
|
|
|
|
|
|
|
public channel: TextBasedChannel;
|
|
|
|
public readonly endReason: string | null;
|
|
|
|
public options: MessageCollectorOptions;
|
|
|
|
public received: number;
|
|
|
|
|
|
|
|
public collect(message: Message): Snowflake | null;
|
|
|
|
public dispose(message: Message): Snowflake | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageComponentInteraction<Cached extends CacheType = CacheType> extends Interaction<Cached> {
|
|
|
|
protected constructor(client: Client, data: RawMessageComponentInteractionData);
|
|
|
|
public readonly component: CacheTypeReducer<
|
|
|
|
Cached,
|
|
|
|
MessageActionRowComponent,
|
2022-05-14 08:06:15 +00:00
|
|
|
Exclude<APIMessageComponent, APIActionRowComponent<APIMessageActionRowComponent>>,
|
|
|
|
MessageActionRowComponent | Exclude<APIMessageComponent, APIActionRowComponent<APIMessageActionRowComponent>>,
|
|
|
|
MessageActionRowComponent | Exclude<APIMessageComponent, APIActionRowComponent<APIMessageActionRowComponent>>
|
2022-03-19 10:37:45 +00:00
|
|
|
>;
|
|
|
|
public componentType: Exclude<MessageComponentType, 'ACTION_ROW'>;
|
|
|
|
public customId: string;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public deferred: boolean;
|
|
|
|
public ephemeral: boolean | null;
|
|
|
|
public message: GuildCacheMessage<Cached>;
|
|
|
|
public replied: boolean;
|
|
|
|
public webhook: InteractionWebhook;
|
2022-05-14 08:06:15 +00:00
|
|
|
public awaitModalSubmit(
|
|
|
|
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
|
|
|
): Promise<ModalSubmitInteraction<Cached>>;
|
|
|
|
public inGuild(): this is MessageComponentInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is MessageComponentInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is MessageComponentInteraction<'raw'>;
|
|
|
|
public deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public deferReply(options?: InteractionDeferReplyOptions): Promise<void>;
|
|
|
|
public deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<void>;
|
2022-11-26 15:02:34 +00:00
|
|
|
public deleteReply(message?: MessageResolvable | '@original'): Promise<void>;
|
|
|
|
public editReply(options: string | MessagePayload | InteractionEditReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public fetchReply(message?: MessageResolvable | '@original'): Promise<GuildCacheMessage<Cached>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public reply(options: string | MessagePayload | InteractionReplyOptions): Promise<void>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public showModal(modal: Modal | ModalOptions): Promise<void>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public update(options: string | MessagePayload | InteractionUpdateOptions): Promise<void>;
|
|
|
|
|
|
|
|
public static resolveType(type: MessageComponentTypeResolvable): MessageComponentType;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageContextMenuInteraction<
|
|
|
|
Cached extends CacheType = CacheType,
|
2022-04-16 10:44:43 +00:00
|
|
|
> extends ContextMenuInteraction<Cached> {
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly targetMessage: NonNullable<CommandInteractionOption<Cached>['message']>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is MessageContextMenuInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is MessageContextMenuInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is MessageContextMenuInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageEmbed {
|
|
|
|
private _fieldEquals(field: EmbedField, other: EmbedField): boolean;
|
|
|
|
|
|
|
|
public constructor(data?: MessageEmbed | MessageEmbedOptions | APIEmbed);
|
|
|
|
public author: MessageEmbedAuthor | null;
|
|
|
|
public color: number | null;
|
|
|
|
public readonly createdAt: Date | null;
|
|
|
|
public description: string | null;
|
|
|
|
public fields: EmbedField[];
|
|
|
|
public footer: MessageEmbedFooter | null;
|
|
|
|
public readonly hexColor: HexColorString | null;
|
|
|
|
public image: MessageEmbedImage | null;
|
|
|
|
public readonly length: number;
|
|
|
|
public provider: MessageEmbedProvider | null;
|
|
|
|
public thumbnail: MessageEmbedThumbnail | null;
|
|
|
|
public timestamp: number | null;
|
|
|
|
public title: string | null;
|
|
|
|
/** @deprecated */
|
|
|
|
public type: string;
|
|
|
|
public url: string | null;
|
|
|
|
public readonly video: MessageEmbedVideo | null;
|
2022-07-26 02:57:57 +00:00
|
|
|
/** @deprecated This method is a wrapper for {@link MessageEmbed#addFields}. Use that instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public addField(name: string, value: string, inline?: boolean): this;
|
|
|
|
public addFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
|
|
|
public setFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
2022-03-24 10:55:32 +00:00
|
|
|
public setAuthor(options: EmbedAuthorData | null): this;
|
|
|
|
/** @deprecated Supply a lone object of interface {@link EmbedAuthorData} instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public setAuthor(name: string, iconURL?: string, url?: string): this;
|
|
|
|
public setColor(color: ColorResolvable): this;
|
|
|
|
public setDescription(description: string): this;
|
2022-03-24 10:55:32 +00:00
|
|
|
public setFooter(options: EmbedFooterData | null): this;
|
|
|
|
/** @deprecated Supply a lone object of interface {@link EmbedFooterData} instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public setFooter(text: string, iconURL?: string): this;
|
|
|
|
public setImage(url: string): this;
|
|
|
|
public setThumbnail(url: string): this;
|
|
|
|
public setTimestamp(timestamp?: Date | number | null): this;
|
|
|
|
public setTitle(title: string): this;
|
|
|
|
public setURL(url: string): this;
|
|
|
|
public spliceFields(index: number, deleteCount: number, ...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
|
|
|
public equals(embed: MessageEmbed | APIEmbed): boolean;
|
|
|
|
public toJSON(): APIEmbed;
|
|
|
|
|
|
|
|
public static normalizeField(name: string, value: string, inline?: boolean): Required<EmbedFieldData>;
|
|
|
|
public static normalizeFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): Required<EmbedFieldData>[];
|
|
|
|
}
|
|
|
|
|
2022-04-01 05:09:46 +00:00
|
|
|
export class WebEmbed {
|
2022-04-01 13:09:32 +00:00
|
|
|
public constructor(data?: WebEmbedOptions);
|
2022-04-01 05:09:46 +00:00
|
|
|
public author: MessageEmbedAuthor | null;
|
2022-06-27 07:00:05 +00:00
|
|
|
public baseURL: string | undefined;
|
|
|
|
public shortenAPI: string | undefined;
|
2022-04-01 05:09:46 +00:00
|
|
|
public color: number | null;
|
|
|
|
public description: string | null;
|
|
|
|
public image: MessageEmbedImage | null;
|
|
|
|
public provider: MessageEmbedProvider | null;
|
|
|
|
public title: string | null;
|
|
|
|
public url: string | null;
|
|
|
|
public video: MessageEmbedVideo | null;
|
2022-04-16 12:01:05 +00:00
|
|
|
public hidden: boolean;
|
|
|
|
public shorten: boolean;
|
2022-04-11 05:53:02 +00:00
|
|
|
public imageType: 'thumbnail' | 'image';
|
2022-04-01 05:09:46 +00:00
|
|
|
public setAuthor(options: EmbedAuthorData | null): this;
|
|
|
|
public setColor(color: ColorResolvable): this;
|
|
|
|
public setDescription(description: string): this;
|
|
|
|
public setImage(url: string): this;
|
2022-04-11 05:53:02 +00:00
|
|
|
public setThumbnail(url: string): this;
|
2022-04-01 05:09:46 +00:00
|
|
|
public setVideo(url: string): this;
|
|
|
|
public setTitle(title: string): this;
|
|
|
|
public setURL(url: string): this;
|
|
|
|
public setProvider(options: MessageEmbedProvider | null): this;
|
2022-04-01 13:09:32 +00:00
|
|
|
public toMessage(): Promise<string>;
|
2022-04-01 05:09:46 +00:00
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class MessageFlags extends BitField<MessageFlagsString> {
|
|
|
|
public static FLAGS: Record<MessageFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<MessageFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageMentions {
|
|
|
|
private constructor(
|
|
|
|
message: Message,
|
|
|
|
users: APIUser[] | Collection<Snowflake, User>,
|
|
|
|
roles: Snowflake[] | Collection<Snowflake, Role>,
|
|
|
|
everyone: boolean,
|
|
|
|
repliedUser?: APIUser | User,
|
|
|
|
);
|
2022-05-14 08:06:15 +00:00
|
|
|
private _channels: Collection<Snowflake, AnyChannel> | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
private readonly _content: string;
|
|
|
|
private _members: Collection<Snowflake, GuildMember> | null;
|
2022-08-01 05:37:46 +00:00
|
|
|
private _parsedUsers: Collection<Snowflake, User> | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
public readonly channels: Collection<Snowflake, AnyChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly client: Client;
|
|
|
|
public everyone: boolean;
|
|
|
|
public readonly guild: Guild;
|
|
|
|
public has(data: UserResolvable | RoleResolvable | ChannelResolvable, options?: MessageMentionsHasOptions): boolean;
|
|
|
|
public readonly members: Collection<Snowflake, GuildMember> | null;
|
2022-08-01 05:37:46 +00:00
|
|
|
public readonly parsedUsers: Collection<Snowflake, User>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public repliedUser: User | null;
|
|
|
|
public roles: Collection<Snowflake, Role>;
|
|
|
|
public users: Collection<Snowflake, User>;
|
|
|
|
public crosspostedChannels: Collection<Snowflake, CrosspostedChannel>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
|
|
|
|
public static CHANNELS_PATTERN: RegExp;
|
|
|
|
public static EVERYONE_PATTERN: RegExp;
|
|
|
|
public static ROLES_PATTERN: RegExp;
|
|
|
|
public static USERS_PATTERN: RegExp;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessagePayload {
|
|
|
|
public constructor(target: MessageTarget, options: MessageOptions | WebhookMessageOptions);
|
|
|
|
public data: RawMessagePayloadData | null;
|
2022-11-27 12:45:58 +00:00
|
|
|
public readonly usingNewAttachmentAPI: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly isUser: boolean;
|
|
|
|
public readonly isWebhook: boolean;
|
|
|
|
public readonly isMessage: boolean;
|
|
|
|
public readonly isMessageManager: boolean;
|
|
|
|
public readonly isInteraction: boolean;
|
|
|
|
public files: HTTPAttachmentData[] | null;
|
|
|
|
public options: MessageOptions | WebhookMessageOptions;
|
|
|
|
public target: MessageTarget;
|
|
|
|
|
|
|
|
public static create(
|
|
|
|
target: MessageTarget,
|
|
|
|
options: string | MessageOptions | WebhookMessageOptions,
|
|
|
|
extra?: MessageOptions | WebhookMessageOptions,
|
|
|
|
): MessagePayload;
|
|
|
|
public static resolveFile(
|
|
|
|
fileLike: BufferResolvable | Stream | FileOptions | MessageAttachment,
|
|
|
|
): Promise<HTTPAttachmentData>;
|
|
|
|
|
|
|
|
public makeContent(): string | undefined;
|
|
|
|
public resolveData(): this;
|
|
|
|
public resolveFiles(): Promise<this>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageReaction {
|
|
|
|
private constructor(client: Client, data: RawMessageReactionData, message: Message);
|
|
|
|
private _emoji: GuildEmoji | ReactionEmoji;
|
|
|
|
|
|
|
|
public readonly client: Client;
|
|
|
|
public count: number;
|
|
|
|
public readonly emoji: GuildEmoji | ReactionEmoji;
|
|
|
|
public me: boolean;
|
|
|
|
public message: Message | PartialMessage;
|
|
|
|
public readonly partial: false;
|
|
|
|
public users: ReactionUserManager;
|
|
|
|
public remove(): Promise<MessageReaction>;
|
|
|
|
public fetch(): Promise<MessageReaction>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageSelectMenu extends BaseMessageComponent {
|
|
|
|
public constructor(data?: MessageSelectMenu | MessageSelectMenuOptions | APISelectMenuComponent);
|
2023-02-28 06:42:35 +00:00
|
|
|
public channelTypes: ChannelTypes[];
|
2022-03-19 10:37:45 +00:00
|
|
|
public customId: string | null;
|
|
|
|
public disabled: boolean;
|
|
|
|
public maxValues: number | null;
|
|
|
|
public minValues: number | null;
|
|
|
|
public options: MessageSelectOption[];
|
|
|
|
public placeholder: string | null;
|
2022-12-18 06:17:48 +00:00
|
|
|
public type: SelectMenuComponentType;
|
2023-02-28 06:42:35 +00:00
|
|
|
public addChannelTypes(...channelTypes: ChannelTypes[]): this;
|
2022-03-19 10:37:45 +00:00
|
|
|
public addOptions(...options: MessageSelectOptionData[] | MessageSelectOptionData[][]): this;
|
|
|
|
public setOptions(...options: MessageSelectOptionData[] | MessageSelectOptionData[][]): this;
|
2022-11-06 05:34:25 +00:00
|
|
|
public setChannelTypes(...channelTypes: ChannelTypes[]): this;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setCustomId(customId: string): this;
|
|
|
|
public setDisabled(disabled?: boolean): this;
|
|
|
|
public setMaxValues(maxValues: number): this;
|
|
|
|
public setMinValues(minValues: number): this;
|
|
|
|
public setPlaceholder(placeholder: string): this;
|
2023-02-28 06:42:35 +00:00
|
|
|
public setType(type: SelectMenuComponentType | SelectMenuComponentTypes): this;
|
2022-03-19 10:37:45 +00:00
|
|
|
public spliceOptions(
|
|
|
|
index: number,
|
|
|
|
deleteCount: number,
|
|
|
|
...options: MessageSelectOptionData[] | MessageSelectOptionData[][]
|
|
|
|
): this;
|
|
|
|
public toJSON(): APISelectMenuComponent;
|
2022-12-03 18:13:19 +00:00
|
|
|
public select(message: Message, values?: any[]): Promise<InteractionResponse>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export class Modal {
|
|
|
|
public constructor(data?: Modal | ModalOptions);
|
|
|
|
public components: MessageActionRow<ModalActionRowComponent>[];
|
|
|
|
public customId: string | null;
|
|
|
|
public title: string | null;
|
2022-06-13 16:53:43 +00:00
|
|
|
public application: object | null;
|
|
|
|
public client: Client | null;
|
|
|
|
public nonce: Snowflake | null;
|
2022-10-09 12:37:04 +00:00
|
|
|
public readonly sendFromInteraction: InteractionResponse | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
public addComponents(
|
|
|
|
...components: (
|
|
|
|
| MessageActionRow<ModalActionRowComponent>
|
|
|
|
| (Required<BaseMessageComponentOptions> & MessageActionRowOptions<ModalActionRowComponentResolvable>)
|
|
|
|
)[]
|
|
|
|
): this;
|
|
|
|
public setComponents(
|
|
|
|
...components: (
|
|
|
|
| MessageActionRow<ModalActionRowComponent>
|
|
|
|
| (Required<BaseMessageComponentOptions> & MessageActionRowOptions<ModalActionRowComponentResolvable>)
|
|
|
|
)[]
|
|
|
|
): this;
|
|
|
|
public setCustomId(customId: string): this;
|
|
|
|
public spliceComponents(
|
|
|
|
index: number,
|
|
|
|
deleteCount: number,
|
|
|
|
...components: (
|
|
|
|
| MessageActionRow<ModalActionRowComponent>
|
|
|
|
| (Required<BaseMessageComponentOptions> & MessageActionRowOptions<ModalActionRowComponentResolvable>)
|
|
|
|
)[]
|
|
|
|
): this;
|
|
|
|
public setTitle(title: string): this;
|
|
|
|
public toJSON(): RawModalSubmitInteractionData;
|
2022-10-09 12:37:04 +00:00
|
|
|
public reply(data: ModalReplyData): Promise<InteractionResponse>;
|
2022-06-13 16:53:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModalReplyData {
|
2022-10-09 12:37:04 +00:00
|
|
|
guild?: GuildResolvable;
|
|
|
|
channel?: TextChannelResolvable;
|
2022-12-12 12:28:13 +00:00
|
|
|
data?: TextInputComponentReplyData[];
|
2022-09-29 12:45:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TextInputComponentReplyData {
|
2022-06-13 16:53:43 +00:00
|
|
|
customId: string;
|
|
|
|
value: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class ModalSubmitFieldsResolver {
|
|
|
|
constructor(components: PartialModalActionRow[]);
|
|
|
|
private readonly _fields: PartialTextInputData[];
|
|
|
|
public getField(customId: string): PartialTextInputData;
|
|
|
|
public getTextInputValue(customId: string): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModalMessageModalSubmitInteraction<Cached extends CacheType = CacheType>
|
|
|
|
extends ModalSubmitInteraction<Cached> {
|
|
|
|
message: GuildCacheMessage<Cached>;
|
2022-08-17 10:46:24 +00:00
|
|
|
channelId: Snowflake;
|
2022-05-14 08:06:15 +00:00
|
|
|
update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
update(options: string | MessagePayload | InteractionUpdateOptions): Promise<void>;
|
|
|
|
deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
deferUpdate(options?: InteractionDeferUpdateOptions): Promise<void>;
|
|
|
|
inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>;
|
|
|
|
inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>;
|
|
|
|
inRawGuild(): this is ModalMessageModalSubmitInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ModalSubmitInteraction<Cached extends CacheType = CacheType> extends Interaction<Cached> {
|
|
|
|
protected constructor(client: Client, data: RawModalSubmitInteractionData);
|
|
|
|
public customId: string;
|
|
|
|
public components: PartialModalActionRow[];
|
|
|
|
public deferred: boolean;
|
|
|
|
public ephemeral: boolean | null;
|
|
|
|
public message: GuildCacheMessage<Cached> | null;
|
|
|
|
public fields: ModalSubmitFieldsResolver;
|
|
|
|
public replied: false;
|
|
|
|
public webhook: InteractionWebhook;
|
|
|
|
public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public reply(options: string | MessagePayload | InteractionReplyOptions): Promise<void>;
|
2022-11-26 15:02:34 +00:00
|
|
|
public deleteReply(message?: MessageResolvable | '@original'): Promise<void>;
|
|
|
|
public editReply(options: string | MessagePayload | InteractionEditReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public deferReply(options: InteractionDeferReplyOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public deferReply(options?: InteractionDeferReplyOptions): Promise<void>;
|
|
|
|
public deferUpdate(options: InteractionDeferUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<void>;
|
2022-11-26 15:02:34 +00:00
|
|
|
public fetchReply(message?: MessageResolvable | '@original'): Promise<GuildCacheMessage<Cached>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>;
|
|
|
|
public inCachedGuild(): this is ModalSubmitInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is ModalSubmitInteraction<'raw'>;
|
|
|
|
public isFromMessage(): this is ModalMessageModalSubmitInteraction<Cached>;
|
|
|
|
public update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
|
|
|
|
public update(options: string | MessagePayload | InteractionUpdateOptions): Promise<void>;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class NewsChannel extends BaseGuildTextChannel {
|
2022-10-03 12:25:39 +00:00
|
|
|
public threads: GuildTextThreadManager<AllowedThreadTypeForNewsChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public type: 'GUILD_NEWS';
|
|
|
|
public addFollower(channel: TextChannelResolvable, reason?: string): Promise<NewsChannel>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class OAuth2Guild extends BaseGuild {
|
|
|
|
private constructor(client: Client, data: RawOAuth2GuildData);
|
|
|
|
public owner: boolean;
|
|
|
|
public permissions: Readonly<Permissions>;
|
|
|
|
}
|
|
|
|
|
2022-06-06 04:21:36 +00:00
|
|
|
export class PartialGroupDMChannel extends TextBasedChannelMixin(Channel, [
|
|
|
|
'bulkDelete',
|
|
|
|
'fetchWebhooks',
|
|
|
|
'createWebhook',
|
|
|
|
'setRateLimitPerUser',
|
|
|
|
'setNSFW',
|
|
|
|
]) {
|
2022-03-19 10:37:45 +00:00
|
|
|
private constructor(client: Client, data: RawPartialGroupDMChannelData);
|
|
|
|
public name: string | null;
|
|
|
|
public icon: string | null;
|
2022-09-16 12:08:15 +00:00
|
|
|
public readonly recipients: Collection<Snowflake, User>;
|
2022-06-04 06:26:53 +00:00
|
|
|
public messages: MessageManager;
|
|
|
|
public invites: Collection<string, Invite>;
|
2022-04-03 04:53:09 +00:00
|
|
|
public lastMessageId: Snowflake | null;
|
2022-06-04 06:26:53 +00:00
|
|
|
public lastPinTimestamp: number | null;
|
2022-04-03 04:53:09 +00:00
|
|
|
public owner: User | null;
|
|
|
|
public ownerId: Snowflake | null;
|
2022-10-03 12:25:39 +00:00
|
|
|
public flags: null;
|
2022-10-27 12:29:45 +00:00
|
|
|
public messageRequest: boolean | undefined;
|
|
|
|
public messageRequestTimestamp: Date | undefined;
|
|
|
|
public acceptMessageRequest(): Promise<this>;
|
|
|
|
public cancelMessageRequest(): Promise<this>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public iconURL(options?: StaticImageURLOptions): string | null;
|
2022-04-03 04:53:09 +00:00
|
|
|
public addMember(user: User): Promise<PartialGroupDMChannel>;
|
|
|
|
public removeMember(user: User): Promise<PartialGroupDMChannel>;
|
|
|
|
public setName(name: string): Promise<PartialGroupDMChannel>;
|
|
|
|
public setIcon(icon: Base64Resolvable | null): Promise<PartialGroupDMChannel>;
|
|
|
|
public getInvite(): Promise<Invite>;
|
2022-06-04 06:26:53 +00:00
|
|
|
public fetchInvite(force: boolean): Promise<Invite>;
|
2022-04-03 04:53:09 +00:00
|
|
|
public removeInvite(invite: Invite): Promise<PartialGroupDMChannel>;
|
2022-08-19 11:16:11 +00:00
|
|
|
public delete(slient?: boolean): Promise<this>;
|
|
|
|
public setOwner(user: UserResolvable): Promise<PartialGroupDMChannel>;
|
2022-05-21 13:58:33 +00:00
|
|
|
public readonly voiceAdapterCreator: InternalDiscordGatewayAdapterCreator;
|
2022-10-24 16:29:09 +00:00
|
|
|
public call(options?: CallOptions): Promise<VoiceConnection>;
|
2022-08-14 10:16:51 +00:00
|
|
|
public sync(): undefined;
|
2022-05-21 13:58:33 +00:00
|
|
|
public readonly shard: WebSocketShard;
|
2022-08-14 10:16:51 +00:00
|
|
|
public readonly voiceUsers: Collection<Snowflake, User>;
|
|
|
|
public readonly voiceConnection?: VoiceConnection;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class PermissionOverwrites extends Base {
|
|
|
|
private constructor(client: Client, data: RawPermissionOverwriteData, channel: NonThreadGuildBasedChannel);
|
|
|
|
public allow: Readonly<Permissions>;
|
|
|
|
public readonly channel: NonThreadGuildBasedChannel;
|
|
|
|
public deny: Readonly<Permissions>;
|
|
|
|
public id: Snowflake;
|
|
|
|
public type: OverwriteType;
|
|
|
|
public edit(options: PermissionOverwriteOptions, reason?: string): Promise<PermissionOverwrites>;
|
|
|
|
public delete(reason?: string): Promise<PermissionOverwrites>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public static resolveOverwriteOptions(
|
|
|
|
options: PermissionOverwriteOptions,
|
|
|
|
initialPermissions: { allow?: PermissionResolvable; deny?: PermissionResolvable },
|
|
|
|
): ResolvedOverwriteOptions;
|
|
|
|
public static resolve(overwrite: OverwriteResolvable, guild: Guild): APIOverwrite;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Permissions extends BitField<PermissionString, bigint> {
|
|
|
|
public any(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
|
|
|
|
public has(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
|
|
|
|
public missing(bits: BitFieldResolvable<PermissionString, bigint>, checkAdmin?: boolean): PermissionString[];
|
|
|
|
public serialize(checkAdmin?: boolean): Record<PermissionString, boolean>;
|
2022-03-24 10:55:32 +00:00
|
|
|
public toArray(): PermissionString[];
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
public static ALL: bigint;
|
|
|
|
public static DEFAULT: bigint;
|
|
|
|
public static STAGE_MODERATOR: bigint;
|
|
|
|
public static FLAGS: PermissionFlags;
|
|
|
|
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 readonly member: GuildMember | null;
|
|
|
|
public status: PresenceStatus;
|
|
|
|
public readonly user: User | null;
|
|
|
|
public userId: Snowflake;
|
|
|
|
public equals(presence: Presence): boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ReactionCollector extends Collector<Snowflake | string, MessageReaction, [User]> {
|
|
|
|
public constructor(message: Message, options?: ReactionCollectorOptions);
|
|
|
|
private _handleChannelDeletion(channel: NonThreadGuildBasedChannel): void;
|
|
|
|
private _handleGuildDeletion(guild: Guild): void;
|
|
|
|
private _handleMessageDeletion(message: Message): void;
|
|
|
|
|
|
|
|
public readonly endReason: string | null;
|
|
|
|
public message: Message;
|
|
|
|
public options: ReactionCollectorOptions;
|
|
|
|
public total: number;
|
|
|
|
public users: Collection<Snowflake, User>;
|
|
|
|
|
|
|
|
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', listener: (reaction: MessageReaction, user: User) => void): this;
|
|
|
|
public on(event: 'end', listener: (collected: Collection<Snowflake, MessageReaction>, reason: string) => void): this;
|
|
|
|
public on(event: string, listener: (...args: any[]) => void): this;
|
|
|
|
|
|
|
|
public once(event: 'collect' | 'dispose' | 'remove', listener: (reaction: MessageReaction, user: User) => void): this;
|
|
|
|
public once(
|
|
|
|
event: 'end',
|
|
|
|
listener: (collected: Collection<Snowflake, MessageReaction>, 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);
|
2023-04-02 05:46:18 +00:00
|
|
|
public readonly activity: Activity;
|
2022-03-19 10:37:45 +00:00
|
|
|
public largeImage: Snowflake | null;
|
|
|
|
public largeText: string | null;
|
|
|
|
public smallImage: Snowflake | null;
|
|
|
|
public smallText: string | null;
|
|
|
|
public largeImageURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public smallImageURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Role extends Base {
|
|
|
|
private constructor(client: Client, data: RawRoleData, guild: Guild);
|
|
|
|
public color: number;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public readonly editable: boolean;
|
|
|
|
public guild: Guild;
|
|
|
|
public readonly hexColor: HexColorString;
|
|
|
|
public hoist: boolean;
|
|
|
|
public id: Snowflake;
|
|
|
|
public managed: boolean;
|
|
|
|
public readonly members: Collection<Snowflake, GuildMember>;
|
|
|
|
public mentionable: boolean;
|
|
|
|
public name: string;
|
|
|
|
public permissions: Readonly<Permissions>;
|
|
|
|
public readonly 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<Role>;
|
|
|
|
public edit(data: RoleData, reason?: string): Promise<Role>;
|
|
|
|
public equals(role: Role): boolean;
|
|
|
|
public iconURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
public permissionsIn(channel: NonThreadGuildBasedChannel | Snowflake, checkAdmin?: boolean): Readonly<Permissions>;
|
|
|
|
public setColor(color: ColorResolvable, reason?: string): Promise<Role>;
|
|
|
|
public setHoist(hoist?: boolean, reason?: string): Promise<Role>;
|
|
|
|
public setMentionable(mentionable?: boolean, reason?: string): Promise<Role>;
|
|
|
|
public setName(name: string, reason?: string): Promise<Role>;
|
|
|
|
public setPermissions(permissions: PermissionResolvable, reason?: string): Promise<Role>;
|
|
|
|
public setIcon(icon: BufferResolvable | Base64Resolvable | EmojiResolvable | null, reason?: string): Promise<Role>;
|
|
|
|
public setPosition(position: number, options?: SetRolePositionOptions): Promise<Role>;
|
|
|
|
public setUnicodeEmoji(unicodeEmoji: string | null, reason?: string): Promise<Role>;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): RoleMention;
|
|
|
|
|
|
|
|
/** @deprecated Use {@link RoleManager.comparePositions} instead. */
|
|
|
|
public static comparePositions(role1: Role, role2: Role): number;
|
|
|
|
}
|
|
|
|
|
2023-02-28 14:06:55 +00:00
|
|
|
export class BaseSelectMenuInteraction<
|
|
|
|
Cached extends CacheType = CacheType,
|
|
|
|
> extends MessageComponentInteraction<Cached> {
|
2022-03-19 10:37:45 +00:00
|
|
|
public constructor(client: Client, data: RawMessageSelectMenuInteractionData);
|
|
|
|
public readonly component: CacheTypeReducer<
|
|
|
|
Cached,
|
|
|
|
MessageSelectMenu,
|
|
|
|
APISelectMenuComponent,
|
|
|
|
MessageSelectMenu | APISelectMenuComponent,
|
|
|
|
MessageSelectMenu | APISelectMenuComponent
|
|
|
|
>;
|
2022-12-18 06:17:48 +00:00
|
|
|
public componentType: SelectMenuComponentType;
|
2022-03-19 10:37:45 +00:00
|
|
|
public values: string[];
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is SelectMenuInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is SelectMenuInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is SelectMenuInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
2023-02-28 06:42:35 +00:00
|
|
|
export class ChannelSelectInteraction<Cached extends CacheType = CacheType> extends BaseSelectMenuInteraction<Cached> {
|
|
|
|
public componentType: 'CHANNEL_SELECT';
|
|
|
|
public channels: Collection<
|
|
|
|
Snowflake,
|
|
|
|
CacheTypeReducer<Cached, Channel, APIChannel, Channel | APIChannel, Channel | APIChannel>
|
|
|
|
>;
|
|
|
|
public inGuild(): this is ChannelSelectInteraction<'raw' | 'cached'>;
|
|
|
|
public inCachedGuild(): this is ChannelSelectInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is ChannelSelectInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MentionableSelectInteraction<
|
|
|
|
Cached extends CacheType = CacheType,
|
|
|
|
> extends BaseSelectMenuInteraction<Cached> {
|
|
|
|
public componentType: 'MENTIONABLE_SELECT';
|
|
|
|
public channels?: Collection<
|
|
|
|
Snowflake,
|
|
|
|
CacheTypeReducer<Cached, Channel, APIChannel, Channel | APIChannel, Channel | APIChannel>
|
|
|
|
>;
|
|
|
|
public members?: Collection<
|
|
|
|
Snowflake,
|
|
|
|
CacheTypeReducer<Cached, GuildMember, APIGuildMember, GuildMember | APIGuildMember, GuildMember | APIGuildMember>
|
|
|
|
>;
|
|
|
|
public roles?: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole, Role | APIRole, Role | APIRole>>;
|
|
|
|
public users?: Collection<Snowflake, User>;
|
|
|
|
public inGuild(): this is MentionableSelectInteraction<'raw' | 'cached'>;
|
|
|
|
public inCachedGuild(): this is MentionableSelectInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is MentionableSelectInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class RoleSelectInteraction<Cached extends CacheType = CacheType> extends BaseSelectMenuInteraction<Cached> {
|
|
|
|
public componentType: 'ROLE_SELECT';
|
|
|
|
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole, Role | APIRole, Role | APIRole>>;
|
|
|
|
public inGuild(): this is RoleSelectInteraction<'raw' | 'cached'>;
|
|
|
|
public inCachedGuild(): this is RoleSelectInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is RoleSelectInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class StringSelectInteraction<Cached extends CacheType = CacheType> extends BaseSelectMenuInteraction<Cached> {
|
|
|
|
public componentType: 'STRING_SELECT';
|
|
|
|
public roles: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole, Role | APIRole, Role | APIRole>>;
|
|
|
|
public inGuild(): this is StringSelectInteraction<'raw' | 'cached'>;
|
|
|
|
public inCachedGuild(): this is StringSelectInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is StringSelectInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class UserSelectInteraction<Cached extends CacheType = CacheType> extends BaseSelectMenuInteraction<Cached> {
|
|
|
|
public componentType: 'USER_SELECT';
|
|
|
|
public members?: Collection<
|
|
|
|
Snowflake,
|
|
|
|
CacheTypeReducer<Cached, GuildMember, APIGuildMember, GuildMember | APIGuildMember, GuildMember | APIGuildMember>
|
|
|
|
>;
|
|
|
|
public users: Collection<Snowflake, User>;
|
|
|
|
public inGuild(): this is UserSelectInteraction<'raw' | 'cached'>;
|
|
|
|
public inCachedGuild(): this is UserSelectInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is UserSelectInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SelectMenuInteraction<Cached extends CacheType = CacheType> =
|
|
|
|
| StringSelectInteraction<Cached>
|
|
|
|
| ChannelSelectInteraction<Cached>
|
|
|
|
| MentionableSelectInteraction<Cached>
|
|
|
|
| RoleSelectInteraction<Cached>
|
|
|
|
| UserSelectInteraction<Cached>;
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface ShardEventTypes {
|
2022-07-01 02:59:57 +00:00
|
|
|
spawn: [process: ChildProcess | Worker];
|
|
|
|
death: [process: ChildProcess | Worker];
|
2022-03-19 10:37:45 +00:00
|
|
|
disconnect: [];
|
|
|
|
ready: [];
|
2022-06-24 01:44:07 +00:00
|
|
|
reconnecting: [];
|
2022-03-19 10:37:45 +00:00
|
|
|
error: [error: Error];
|
|
|
|
message: [message: any];
|
|
|
|
}
|
|
|
|
export class Shard extends EventEmitter {
|
|
|
|
private constructor(manager: ShardingManager, id: number);
|
|
|
|
private _evals: Map<string, Promise<unknown>>;
|
|
|
|
private _exitListener: (...args: any[]) => void;
|
|
|
|
private _fetches: Map<string, Promise<unknown>>;
|
|
|
|
private _handleExit(respawn?: boolean, timeout?: number): void;
|
|
|
|
private _handleMessage(message: unknown): void;
|
2022-05-14 08:06:15 +00:00
|
|
|
private incrementMaxListeners(emitter: EventEmitter | ChildProcess): void;
|
|
|
|
private decrementMaxListeners(emitter: EventEmitter | ChildProcess): void;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
public args: string[];
|
|
|
|
public execArgv: string[];
|
|
|
|
public env: unknown;
|
|
|
|
public id: number;
|
|
|
|
public manager: ShardingManager;
|
|
|
|
public process: ChildProcess | null;
|
|
|
|
public ready: boolean;
|
|
|
|
public worker: Worker | null;
|
|
|
|
public eval(script: string): Promise<unknown>;
|
|
|
|
public eval<T>(fn: (client: Client) => T): Promise<T>;
|
|
|
|
public eval<T, P>(fn: (client: Client, context: Serialized<P>) => T, context: P): Promise<T>;
|
|
|
|
public fetchClientValue(prop: string): Promise<unknown>;
|
|
|
|
public kill(): void;
|
|
|
|
public respawn(options?: { delay?: number; timeout?: number }): Promise<ChildProcess>;
|
|
|
|
public send(message: unknown): Promise<Shard>;
|
|
|
|
public spawn(timeout?: number): Promise<ChildProcess>;
|
|
|
|
|
|
|
|
public on<K extends keyof ShardEventTypes>(
|
|
|
|
event: K,
|
|
|
|
listener: (...args: ShardEventTypes[K]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public once<K extends keyof ShardEventTypes>(
|
|
|
|
event: K,
|
|
|
|
listener: (...args: ShardEventTypes[K]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ShardClientUtil {
|
|
|
|
private constructor(client: Client, mode: ShardingManagerMode);
|
|
|
|
private _handleMessage(message: unknown): void;
|
|
|
|
private _respond(type: string, message: unknown): void;
|
2022-05-14 08:06:15 +00:00
|
|
|
private incrementMaxListeners(emitter: EventEmitter | ChildProcess): void;
|
|
|
|
private decrementMaxListeners(emitter: EventEmitter | ChildProcess): void;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
public client: Client;
|
|
|
|
public readonly count: number;
|
|
|
|
public readonly ids: number[];
|
|
|
|
public mode: ShardingManagerMode;
|
|
|
|
public parentPort: MessagePort | null;
|
|
|
|
public broadcastEval<T>(fn: (client: Client) => Awaitable<T>): Promise<Serialized<T>[]>;
|
|
|
|
public broadcastEval<T>(fn: (client: Client) => Awaitable<T>, options: { shard: number }): Promise<Serialized<T>>;
|
|
|
|
public broadcastEval<T, P>(
|
|
|
|
fn: (client: Client, context: Serialized<P>) => Awaitable<T>,
|
|
|
|
options: { context: P },
|
|
|
|
): Promise<Serialized<T>[]>;
|
|
|
|
public broadcastEval<T, P>(
|
|
|
|
fn: (client: Client, context: Serialized<P>) => Awaitable<T>,
|
|
|
|
options: { context: P; shard: number },
|
|
|
|
): Promise<Serialized<T>>;
|
|
|
|
public fetchClientValues(prop: string): Promise<unknown[]>;
|
|
|
|
public fetchClientValues(prop: string, shard: number): Promise<unknown>;
|
|
|
|
public respawnAll(options?: MultipleShardRespawnOptions): Promise<void>;
|
|
|
|
public send(message: unknown): Promise<void>;
|
|
|
|
|
|
|
|
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<unknown[]>;
|
|
|
|
private _performOnShards(method: string, args: unknown[], shard: number): Promise<unknown>;
|
|
|
|
|
|
|
|
public file: string;
|
|
|
|
public respawn: boolean;
|
|
|
|
public shardArgs: string[];
|
|
|
|
public shards: Collection<number, Shard>;
|
|
|
|
public token: string | null;
|
|
|
|
public totalShards: number | 'auto';
|
|
|
|
public shardList: number[] | 'auto';
|
|
|
|
public broadcast(message: unknown): Promise<Shard[]>;
|
|
|
|
public broadcastEval<T>(fn: (client: Client) => Awaitable<T>): Promise<Serialized<T>[]>;
|
|
|
|
public broadcastEval<T>(fn: (client: Client) => Awaitable<T>, options: { shard: number }): Promise<Serialized<T>>;
|
|
|
|
public broadcastEval<T, P>(
|
|
|
|
fn: (client: Client, context: Serialized<P>) => Awaitable<T>,
|
|
|
|
options: { context: P },
|
|
|
|
): Promise<Serialized<T>[]>;
|
|
|
|
public broadcastEval<T, P>(
|
|
|
|
fn: (client: Client, context: Serialized<P>) => Awaitable<T>,
|
|
|
|
options: { context: P; shard: number },
|
|
|
|
): Promise<Serialized<T>>;
|
|
|
|
public createShard(id: number): Shard;
|
|
|
|
public fetchClientValues(prop: string): Promise<unknown[]>;
|
|
|
|
public fetchClientValues(prop: string, shard: number): Promise<unknown>;
|
|
|
|
public respawnAll(options?: MultipleShardRespawnOptions): Promise<Collection<number, Shard>>;
|
|
|
|
public spawn(options?: MultipleShardSpawnOptions): Promise<Collection<number, Shard>>;
|
|
|
|
|
|
|
|
public on(event: 'shardCreate', listener: (shard: Shard) => Awaitable<void>): this;
|
|
|
|
|
|
|
|
public once(event: 'shardCreate', listener: (shard: Shard) => Awaitable<void>): this;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SnowflakeUtil extends null {
|
|
|
|
private constructor();
|
|
|
|
public static deconstruct(snowflake: Snowflake): DeconstructedSnowflake;
|
|
|
|
public static generate(timestamp?: number | Date): Snowflake;
|
|
|
|
public static timestampFrom(snowflake: Snowflake): number;
|
|
|
|
public static readonly EPOCH: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class StageChannel extends BaseGuildVoiceChannel {
|
2023-04-15 12:53:43 +00:00
|
|
|
public readonly stageInstance: StageInstance | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public topic: string | null;
|
|
|
|
public type: 'GUILD_STAGE_VOICE';
|
|
|
|
public createStageInstance(options: StageInstanceCreateOptions): Promise<StageInstance>;
|
|
|
|
public setTopic(topic: string): Promise<StageChannel>;
|
|
|
|
}
|
|
|
|
|
2022-10-03 12:25:39 +00:00
|
|
|
export class DirectoryChannel extends Channel {
|
|
|
|
public flags: Readonly<ChannelFlags>;
|
|
|
|
}
|
2022-05-14 08:06:15 +00:00
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class StageInstance extends Base {
|
|
|
|
private constructor(client: Client, data: RawStageInstanceData, channel: StageChannel);
|
|
|
|
public id: Snowflake;
|
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public guildId: Snowflake;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public topic: string;
|
|
|
|
public privacyLevel: PrivacyLevel;
|
|
|
|
public discoverableDisabled: boolean | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
public guildScheduledEventId?: Snowflake;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly channel: StageChannel | null;
|
|
|
|
public readonly guild: Guild | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
public get guildScheduledEvent(): GuildScheduledEvent | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public edit(options: StageInstanceEditOptions): Promise<StageInstance>;
|
|
|
|
public delete(): Promise<StageInstance>;
|
|
|
|
public setTopic(topic: string): Promise<StageInstance>;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Sticker extends Base {
|
|
|
|
private constructor(client: Client, data: RawStickerData);
|
|
|
|
/** @deprecated This will be removed in the next major version, see https://github.com/discordjs/discord.js/issues/7091 */
|
|
|
|
public deleted: boolean;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public available: boolean | null;
|
|
|
|
public description: string | null;
|
|
|
|
public format: StickerFormatType;
|
|
|
|
public readonly guild: Guild | null;
|
|
|
|
public guildId: Snowflake | null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string;
|
|
|
|
public packId: Snowflake | null;
|
|
|
|
public readonly partial: boolean;
|
|
|
|
public sortValue: number | null;
|
|
|
|
public tags: string[] | null;
|
|
|
|
public type: StickerType | null;
|
|
|
|
public user: User | null;
|
|
|
|
public readonly url: string;
|
|
|
|
public fetch(): Promise<Sticker>;
|
|
|
|
public fetchPack(): Promise<StickerPack | null>;
|
|
|
|
public fetchUser(): Promise<User | null>;
|
|
|
|
public edit(data?: GuildStickerEditData, reason?: string): Promise<Sticker>;
|
|
|
|
public delete(reason?: string): Promise<Sticker>;
|
|
|
|
public equals(other: Sticker | unknown): boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class StickerPack extends Base {
|
|
|
|
private constructor(client: Client, data: RawStickerPackData);
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public bannerId: Snowflake | null;
|
|
|
|
public readonly coverSticker: Sticker | null;
|
|
|
|
public coverStickerId: Snowflake | null;
|
|
|
|
public description: string;
|
|
|
|
public id: Snowflake;
|
|
|
|
public name: string;
|
|
|
|
public skuId: Snowflake;
|
|
|
|
public stickers: Collection<Snowflake, Sticker>;
|
|
|
|
public bannerURL(options?: StaticImageURLOptions): string | null;
|
|
|
|
}
|
|
|
|
|
2022-08-14 10:17:37 +00:00
|
|
|
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */
|
2022-03-19 10:37:45 +00:00
|
|
|
export class StoreChannel extends GuildChannel {
|
|
|
|
private constructor(guild: Guild, data?: RawGuildChannelData, client?: Client);
|
|
|
|
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
|
|
|
|
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
|
2022-08-14 10:17:37 +00:00
|
|
|
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */
|
2022-03-19 10:37:45 +00:00
|
|
|
public clone(options?: GuildChannelCloneOptions): Promise<this>;
|
|
|
|
public nsfw: boolean;
|
|
|
|
public type: 'GUILD_STORE';
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Sweepers {
|
|
|
|
public constructor(client: Client, options: SweeperOptions);
|
|
|
|
public readonly client: Client;
|
|
|
|
public intervals: Record<SweeperKey, NodeJS.Timeout | null>;
|
|
|
|
public options: SweeperOptions;
|
|
|
|
|
|
|
|
public sweepApplicationCommands(
|
|
|
|
filter: CollectionSweepFilter<
|
|
|
|
SweeperDefinitions['applicationCommands'][0],
|
|
|
|
SweeperDefinitions['applicationCommands'][1]
|
|
|
|
>,
|
|
|
|
): number;
|
|
|
|
public sweepBans(filter: CollectionSweepFilter<SweeperDefinitions['bans'][0], SweeperDefinitions['bans'][1]>): number;
|
|
|
|
public sweepEmojis(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['emojis'][0], SweeperDefinitions['emojis'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepInvites(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['invites'][0], SweeperDefinitions['invites'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepGuildMembers(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['guildMembers'][0], SweeperDefinitions['guildMembers'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepMessages(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['messages'][0], SweeperDefinitions['messages'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepPresences(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['presences'][0], SweeperDefinitions['presences'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepReactions(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['reactions'][0], SweeperDefinitions['reactions'][1]>,
|
|
|
|
): number;
|
2022-05-14 08:06:15 +00:00
|
|
|
public sweepStageInstances(
|
2022-03-19 10:37:45 +00:00
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['stageInstances'][0], SweeperDefinitions['stageInstances'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepStickers(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['stickers'][0], SweeperDefinitions['stickers'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepThreadMembers(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['threadMembers'][0], SweeperDefinitions['threadMembers'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepThreads(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['threads'][0], SweeperDefinitions['threads'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepUsers(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['users'][0], SweeperDefinitions['users'][1]>,
|
|
|
|
): number;
|
|
|
|
public sweepVoiceStates(
|
|
|
|
filter: CollectionSweepFilter<SweeperDefinitions['voiceStates'][0], SweeperDefinitions['voiceStates'][1]>,
|
|
|
|
): number;
|
|
|
|
|
|
|
|
public static archivedThreadSweepFilter(
|
|
|
|
lifetime?: number,
|
|
|
|
): GlobalSweepFilter<SweeperDefinitions['threads'][0], SweeperDefinitions['threads'][1]>;
|
|
|
|
public static expiredInviteSweepFilter(
|
|
|
|
lifetime?: number,
|
|
|
|
): GlobalSweepFilter<SweeperDefinitions['invites'][0], SweeperDefinitions['invites'][1]>;
|
|
|
|
public static filterByLifetime<K, V>(options?: LifetimeFilterOptions<K, V>): GlobalSweepFilter<K, V>;
|
|
|
|
public static outdatedMessageSweepFilter(
|
|
|
|
lifetime?: number,
|
|
|
|
): GlobalSweepFilter<SweeperDefinitions['messages'][0], SweeperDefinitions['messages'][1]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SystemChannelFlags extends BitField<SystemChannelFlagsString> {
|
|
|
|
public static FLAGS: Record<SystemChannelFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<SystemChannelFlagsString, number>): 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<Snowflake, TeamMember>;
|
|
|
|
|
|
|
|
public readonly owner: TeamMember | null;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
|
|
|
|
public iconURL(options?: StaticImageURLOptions): string | null;
|
2022-12-22 11:37:59 +00:00
|
|
|
public inviteMemeber(user: User, MFACode: number): Promise<TeamMember>;
|
|
|
|
public removeMemeber(userID: Snowflake): boolean;
|
|
|
|
public delete(MFACode: string): Promise<boolean>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public toJSON(): unknown;
|
|
|
|
public toString(): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class TeamMember extends Base {
|
|
|
|
private constructor(team: Team, data: RawTeamMemberData);
|
|
|
|
public team: Team;
|
|
|
|
public readonly id: Snowflake;
|
|
|
|
public permissions: string[];
|
|
|
|
public membershipState: MembershipState;
|
|
|
|
public user: User;
|
|
|
|
|
|
|
|
public toString(): UserMention;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class TextChannel extends BaseGuildTextChannel {
|
|
|
|
public rateLimitPerUser: number;
|
2022-10-03 12:25:39 +00:00
|
|
|
public threads: GuildTextThreadManager<AllowedThreadTypeForTextChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public type: 'GUILD_TEXT';
|
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export class TextInputComponent extends BaseMessageComponent {
|
|
|
|
public constructor(data?: TextInputComponent | TextInputComponentOptions);
|
|
|
|
public customId: string | null;
|
|
|
|
public label: string | null;
|
|
|
|
public required: boolean;
|
|
|
|
public maxLength: number | null;
|
|
|
|
public minLength: number | null;
|
|
|
|
public placeholder: string | null;
|
|
|
|
public style: TextInputStyle;
|
|
|
|
public value: string | null;
|
|
|
|
public setCustomId(customId: string): this;
|
|
|
|
public setLabel(label: string): this;
|
|
|
|
public setRequired(required?: boolean): this;
|
|
|
|
public setMaxLength(maxLength: number): this;
|
|
|
|
public setMinLength(minLength: number): this;
|
|
|
|
public setPlaceholder(placeholder: string): this;
|
|
|
|
public setStyle(style: TextInputStyleResolvable): this;
|
|
|
|
public setValue(value: string): this;
|
|
|
|
public toJSON(): RawTextInputComponentData;
|
|
|
|
public static resolveStyle(style: TextInputStyleResolvable): TextInputStyle;
|
|
|
|
}
|
|
|
|
|
2022-06-06 04:21:36 +00:00
|
|
|
export class ThreadChannel extends TextBasedChannelMixin(Channel, ['fetchWebhooks', 'createWebhook', 'setNSFW']) {
|
2022-03-19 10:37:45 +00:00
|
|
|
private constructor(guild: Guild, data?: RawThreadChannelData, client?: Client, fromInteraction?: boolean);
|
|
|
|
public archived: boolean | null;
|
2023-01-18 07:24:06 +00:00
|
|
|
public readonly firstMessage: Message | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly archivedAt: Date | null;
|
|
|
|
public archiveTimestamp: number | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
public readonly createdAt: Date | null;
|
|
|
|
private _createdTimestamp: number | null;
|
|
|
|
public readonly createdTimestamp: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public autoArchiveDuration: ThreadAutoArchiveDuration | null;
|
|
|
|
public readonly editable: boolean;
|
|
|
|
public guild: Guild;
|
|
|
|
public guildId: Snowflake;
|
|
|
|
public readonly guildMembers: Collection<Snowflake, GuildMember>;
|
|
|
|
public invitable: boolean | null;
|
|
|
|
public readonly joinable: boolean;
|
|
|
|
public readonly joined: boolean;
|
|
|
|
public locked: boolean | null;
|
|
|
|
public readonly manageable: boolean;
|
|
|
|
public readonly viewable: boolean;
|
|
|
|
public readonly sendable: boolean;
|
|
|
|
public memberCount: number | null;
|
|
|
|
public messageCount: number | null;
|
|
|
|
public members: ThreadMemberManager;
|
|
|
|
public name: string;
|
|
|
|
public ownerId: Snowflake | null;
|
2022-10-03 12:25:39 +00:00
|
|
|
public readonly parent: TextChannel | NewsChannel | ForumChannel | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public parentId: Snowflake | null;
|
|
|
|
public rateLimitPerUser: number | null;
|
|
|
|
public type: ThreadChannelTypes;
|
2022-10-03 12:25:39 +00:00
|
|
|
public flags: Readonly<ChannelFlags>;
|
|
|
|
public appliedTags: Snowflake[];
|
|
|
|
public totalMessageSent: number | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly unarchivable: boolean;
|
2022-05-14 08:06:15 +00:00
|
|
|
public isPrivate(): this is this & {
|
|
|
|
readonly createdTimestamp: number;
|
|
|
|
readonly createdAt: Date;
|
|
|
|
type: 'GUILD_PRIVATE_THREAD';
|
|
|
|
};
|
2022-03-19 10:37:45 +00:00
|
|
|
public delete(reason?: string): Promise<this>;
|
|
|
|
public edit(data: ThreadEditData, reason?: string): Promise<ThreadChannel>;
|
|
|
|
public join(): Promise<ThreadChannel>;
|
|
|
|
public leave(): Promise<ThreadChannel>;
|
|
|
|
public permissionsFor(memberOrRole: GuildMember | Role, checkAdmin?: boolean): Readonly<Permissions>;
|
|
|
|
public permissionsFor(
|
|
|
|
memberOrRole: GuildMemberResolvable | RoleResolvable,
|
|
|
|
checkAdmin?: boolean,
|
|
|
|
): Readonly<Permissions> | null;
|
|
|
|
public fetchOwner(options?: BaseFetchOptions): Promise<ThreadMember | null>;
|
2022-08-11 02:57:15 +00:00
|
|
|
public fetchStarterMessage(options?: BaseFetchOptions): Promise<Message | null>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setArchived(archived?: boolean, reason?: string): Promise<ThreadChannel>;
|
|
|
|
public setAutoArchiveDuration(
|
2022-05-14 08:06:15 +00:00
|
|
|
autoArchiveDuration: ThreadAutoArchiveDuration | 'MAX',
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string,
|
|
|
|
): Promise<ThreadChannel>;
|
|
|
|
public setInvitable(invitable?: boolean, reason?: string): Promise<ThreadChannel>;
|
|
|
|
public setLocked(locked?: boolean, reason?: string): Promise<ThreadChannel>;
|
|
|
|
public setName(name: string, reason?: string): Promise<ThreadChannel>;
|
2022-10-03 12:25:39 +00:00
|
|
|
public setAppliedTags(appliedTags: Snowflake[], reason?: string): Promise<ThreadChannel>;
|
2022-10-26 12:38:09 +00:00
|
|
|
public pin(reason?: string): Promise<ThreadChannel>;
|
|
|
|
public unpin(reason?: string): Promise<ThreadChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2023-02-05 08:14:42 +00:00
|
|
|
export class ThreadMember<HasMemberData extends boolean = boolean> extends Base {
|
|
|
|
private constructor(thread: ThreadChannel, data?: RawThreadMemberData, extra?: unknown);
|
2022-03-19 10:37:45 +00:00
|
|
|
public flags: ThreadMemberFlags;
|
2023-02-05 08:14:42 +00:00
|
|
|
public readonly guildMember: HasMemberData extends true ? GuildMember : GuildMember | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public id: Snowflake;
|
|
|
|
public readonly joinedAt: Date | null;
|
|
|
|
public joinedTimestamp: number | null;
|
|
|
|
public readonly manageable: boolean;
|
2023-02-05 08:14:42 +00:00
|
|
|
private member: If<HasMemberData, GuildMember>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public thread: ThreadChannel;
|
|
|
|
public readonly user: User | null;
|
|
|
|
public remove(reason?: string): Promise<ThreadMember>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ThreadMemberFlags extends BitField<ThreadMemberFlagsString> {
|
|
|
|
public static FLAGS: Record<ThreadMemberFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<ThreadMemberFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Typing extends Base {
|
|
|
|
private constructor(channel: TextBasedChannel, user: PartialUser, data?: RawTypingData);
|
|
|
|
public channel: TextBasedChannel;
|
|
|
|
public user: PartialUser;
|
|
|
|
public startedTimestamp: number;
|
|
|
|
public readonly startedAt: Date;
|
|
|
|
public readonly guild: Guild | null;
|
|
|
|
public readonly member: GuildMember | null;
|
|
|
|
public inGuild(): this is this & {
|
|
|
|
channel: TextChannel | NewsChannel | ThreadChannel;
|
|
|
|
readonly guild: Guild;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export class User extends PartialTextBasedChannel(Base) {
|
|
|
|
protected constructor(client: Client, data: RawUserData);
|
|
|
|
private _equals(user: APIUser): boolean;
|
2022-06-26 06:40:26 +00:00
|
|
|
public application: ClientApplication;
|
2022-03-19 10:37:45 +00:00
|
|
|
public accentColor: number | null | undefined;
|
|
|
|
public avatar: string | null;
|
2023-01-06 11:08:20 +00:00
|
|
|
public avatarDecoration: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public banner: string | null | undefined;
|
|
|
|
public bot: boolean;
|
|
|
|
public readonly createdAt: Date;
|
2022-06-04 06:26:53 +00:00
|
|
|
public readonly relationships: RelationshipTypes;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly createdTimestamp: number;
|
|
|
|
public discriminator: string;
|
|
|
|
public readonly defaultAvatarURL: string;
|
|
|
|
public readonly dmChannel: DMChannel | null;
|
|
|
|
public flags: Readonly<UserFlags> | null;
|
2022-06-26 06:40:26 +00:00
|
|
|
public botInGuildsCount: number | null | undefined;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly hexAccentColor: HexColorString | null | undefined;
|
|
|
|
public id: Snowflake;
|
|
|
|
public readonly partial: false;
|
|
|
|
public system: boolean;
|
|
|
|
public readonly tag: string;
|
|
|
|
public username: string;
|
2022-04-14 14:32:11 +00:00
|
|
|
public readonly note: string | null;
|
2022-09-16 12:08:15 +00:00
|
|
|
public readonly nickname: string | null;
|
2022-06-04 06:26:53 +00:00
|
|
|
public readonly connectedAccounts: object[];
|
2022-04-27 03:48:33 +00:00
|
|
|
public readonly premiumSince: Date;
|
|
|
|
public readonly premiumGuildSince: Date;
|
|
|
|
public readonly bio: string | null;
|
|
|
|
public readonly mutualGuilds: Collection<Snowflake, object>;
|
2022-12-13 07:55:51 +00:00
|
|
|
public readonly mutualFriends: Promise<Collection<Snowflake, User>>;
|
2022-07-15 10:41:26 +00:00
|
|
|
public readonly voice: VoiceState;
|
2022-03-19 10:37:45 +00:00
|
|
|
public avatarURL(options?: ImageURLOptions): string | null;
|
2023-01-06 11:08:20 +00:00
|
|
|
public avatarDecorationURL(options?: StaticImageURLOptions): string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public bannerURL(options?: ImageURLOptions): string | null;
|
|
|
|
public createDM(force?: boolean): Promise<DMChannel>;
|
|
|
|
public deleteDM(): Promise<DMChannel>;
|
|
|
|
public displayAvatarURL(options?: ImageURLOptions): string;
|
|
|
|
public equals(user: User): boolean;
|
|
|
|
public fetch(force?: boolean): Promise<User>;
|
|
|
|
public fetchFlags(force?: boolean): Promise<UserFlags>;
|
2022-03-21 11:15:44 +00:00
|
|
|
public setFriend(): Promise<User>;
|
|
|
|
public setBlock(): Promise<User>;
|
|
|
|
public sendFriendRequest(): Promise<User>;
|
|
|
|
public unFriend(): Promise<User>;
|
|
|
|
public unBlock(): Promise<User>;
|
2022-04-16 12:01:05 +00:00
|
|
|
public setNote(note?: any): Promise<string>;
|
2022-08-09 03:42:30 +00:00
|
|
|
public getProfile(guildId?: Snowflake): Promise<User>;
|
2022-09-16 12:08:15 +00:00
|
|
|
public setNickname(nickname: string | null): Promise<boolean>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public toString(): UserMention;
|
2022-07-15 10:41:26 +00:00
|
|
|
public ring(): Promise<boolean>;
|
2022-10-26 12:38:09 +00:00
|
|
|
public themeColors?: [number, number];
|
|
|
|
public readonly hexThemeColor: [string, string] | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class UserContextMenuInteraction<Cached extends CacheType = CacheType> extends ContextMenuInteraction<Cached> {
|
|
|
|
public readonly targetUser: User;
|
|
|
|
public readonly targetMember: CacheTypeReducer<Cached, GuildMember, APIInteractionGuildMember>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public inGuild(): this is UserContextMenuInteraction<'raw' | 'cached'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public inCachedGuild(): this is UserContextMenuInteraction<'cached'>;
|
|
|
|
public inRawGuild(): this is UserContextMenuInteraction<'raw'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class UserFlags extends BitField<UserFlagsString> {
|
|
|
|
public static FLAGS: Record<UserFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<UserFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Util extends null {
|
|
|
|
private constructor();
|
|
|
|
/** @deprecated When not using with `makeCache` use `Sweepers.archivedThreadSweepFilter` instead */
|
|
|
|
public static archivedThreadSweepFilter<K, V>(lifetime?: number): SweepFilter<K, V>;
|
|
|
|
public static basename(path: string, ext?: string): string;
|
|
|
|
public static cleanContent(str: string, channel: TextBasedChannel): string;
|
|
|
|
/** @deprecated Use {@link MessageOptions.allowedMentions} to control mentions in a message instead. */
|
|
|
|
public static removeMentions(str: string): string;
|
2022-03-24 10:55:32 +00:00
|
|
|
private static _removeMentions(str: string): string;
|
2022-03-19 10:37:45 +00:00
|
|
|
public static cloneObject(obj: unknown): unknown;
|
|
|
|
public static discordSort<K, V extends { rawPosition: number; id: Snowflake }>(
|
|
|
|
collection: Collection<K, V>,
|
|
|
|
): Collection<K, V>;
|
|
|
|
public static escapeMarkdown(text: string, options?: EscapeMarkdownOptions): string;
|
|
|
|
public static escapeCodeBlock(text: string): string;
|
|
|
|
public static escapeInlineCode(text: string): string;
|
|
|
|
public static escapeBold(text: string): string;
|
|
|
|
public static escapeItalic(text: string): string;
|
|
|
|
public static escapeUnderline(text: string): string;
|
|
|
|
public static escapeStrikethrough(text: string): string;
|
|
|
|
public static escapeSpoiler(text: string): string;
|
2022-11-04 12:46:05 +00:00
|
|
|
public static escapeEscape(text: string): string;
|
|
|
|
public static escapeHeading(text: string): string;
|
|
|
|
public static escapeBulletedList(text: string): string;
|
|
|
|
public static escapeNumberedList(text: string): string;
|
|
|
|
public static escapeMaskedLink(text: string): string;
|
2022-03-19 10:37:45 +00:00
|
|
|
public static cleanCodeBlockContent(text: string): string;
|
|
|
|
public static flatten(obj: unknown, ...props: Record<string, boolean | string>[]): unknown;
|
|
|
|
public static makeError(obj: MakeErrorOptions): Error;
|
|
|
|
public static makePlainError(err: Error): MakeErrorOptions;
|
|
|
|
public static mergeDefault(def: unknown, given: unknown): unknown;
|
|
|
|
public static moveElementInArray(array: unknown[], element: unknown, newIndex: number, offset?: boolean): number;
|
|
|
|
public static parseEmoji(text: string): { animated: boolean; name: string; id: Snowflake | null } | null;
|
|
|
|
public static resolveColor(color: ColorResolvable): number;
|
|
|
|
public static resolvePartialEmoji(emoji: EmojiIdentifierResolvable): Partial<APIPartialEmoji> | null;
|
|
|
|
public static verifyString(data: string, error?: typeof Error, errorMessage?: string, allowEmpty?: boolean): string;
|
|
|
|
public static setPosition<T extends AnyChannel | Role>(
|
|
|
|
item: T,
|
|
|
|
position: number,
|
|
|
|
relative: boolean,
|
|
|
|
sorted: Collection<Snowflake, T>,
|
|
|
|
route: unknown,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<{ id: Snowflake; position: number }[]>;
|
2022-05-14 08:06:15 +00:00
|
|
|
/** @deprecated This will be removed in the next major version. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public static splitMessage(text: string, options?: SplitOptions): string[];
|
2022-12-26 11:00:14 +00:00
|
|
|
/** @deprecated This will be removed in the next major version. */
|
2022-05-14 08:06:15 +00:00
|
|
|
public static resolveAutoArchiveMaxLimit(guild: Guild): Exclude<ThreadAutoArchiveDuration, 60>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Formatters extends null {
|
|
|
|
public static blockQuote: typeof blockQuote;
|
|
|
|
public static bold: typeof bold;
|
|
|
|
public static channelMention: typeof channelMention;
|
2023-03-26 13:32:10 +00:00
|
|
|
public static chatInputApplicationCommandMention: typeof chatInputApplicationCommandMention;
|
2022-03-19 10:37:45 +00:00
|
|
|
public static codeBlock: typeof codeBlock;
|
|
|
|
public static formatEmoji: typeof formatEmoji;
|
|
|
|
public static hideLinkEmbed: typeof hideLinkEmbed;
|
|
|
|
public static hyperlink: typeof hyperlink;
|
|
|
|
public static inlineCode: typeof inlineCode;
|
|
|
|
public static italic: typeof italic;
|
|
|
|
public static quote: typeof quote;
|
|
|
|
public static roleMention: typeof roleMention;
|
|
|
|
public static spoiler: typeof spoiler;
|
|
|
|
public static strikethrough: typeof strikethrough;
|
|
|
|
public static time: typeof time;
|
|
|
|
public static TimestampStyles: typeof TimestampStyles;
|
|
|
|
public static TimestampStylesString: TimestampStylesString;
|
|
|
|
public static underscore: typeof underscore;
|
|
|
|
public static userMention: typeof userMention;
|
|
|
|
}
|
|
|
|
|
2023-04-15 12:53:43 +00:00
|
|
|
export class VoiceChannel extends BaseGuildVoiceChannel {
|
2022-03-19 10:37:45 +00:00
|
|
|
/** @deprecated Use manageable instead */
|
|
|
|
public readonly editable: boolean;
|
|
|
|
public readonly speakable: boolean;
|
|
|
|
public type: 'GUILD_VOICE';
|
|
|
|
}
|
|
|
|
|
|
|
|
export class VoiceRegion {
|
|
|
|
private constructor(data: RawVoiceRegionData);
|
|
|
|
public custom: boolean;
|
|
|
|
public deprecated: boolean;
|
|
|
|
public id: string;
|
|
|
|
public name: string;
|
|
|
|
public optimal: boolean;
|
2022-05-14 08:06:15 +00:00
|
|
|
/** @deprecated This property is no longer being sent by the API. */
|
2022-03-19 10:37:45 +00:00
|
|
|
public vip: boolean;
|
|
|
|
public toJSON(): unknown;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class VoiceState extends Base {
|
|
|
|
private constructor(guild: Guild, data: RawVoiceStateData);
|
|
|
|
public readonly channel: VoiceBasedChannel | null;
|
|
|
|
public channelId: Snowflake | null;
|
|
|
|
public readonly deaf: boolean | null;
|
|
|
|
public guild: Guild;
|
|
|
|
public id: Snowflake;
|
|
|
|
public readonly member: GuildMember | null;
|
|
|
|
public readonly 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;
|
|
|
|
public selfVideo: boolean | null;
|
|
|
|
public suppress: boolean;
|
|
|
|
public requestToSpeakTimestamp: number | null;
|
2022-07-15 17:50:27 +00:00
|
|
|
public readonly user: User | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setDeaf(deaf?: boolean, reason?: string): Promise<GuildMember>;
|
|
|
|
public setMute(mute?: boolean, reason?: string): Promise<GuildMember>;
|
|
|
|
public disconnect(reason?: string): Promise<GuildMember>;
|
|
|
|
public setChannel(channel: GuildVoiceChannelResolvable | null, reason?: string): Promise<GuildMember>;
|
|
|
|
public setRequestToSpeak(request?: boolean): Promise<void>;
|
|
|
|
public setSuppressed(suppressed?: boolean): Promise<void>;
|
2022-04-25 12:28:45 +00:00
|
|
|
public getPreview(): Promise<string>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Webhook extends WebhookMixin() {
|
|
|
|
private constructor(client: Client, data?: RawWebhookData);
|
|
|
|
public avatar: string;
|
|
|
|
public avatarURL(options?: StaticImageURLOptions): string | null;
|
2023-01-26 06:52:12 +00:00
|
|
|
public readonly channel: TextChannel | VoiceChannel | NewsChannel | ForumChannel | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public channelId: Snowflake;
|
|
|
|
public 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 isIncoming(): this is this & { token: string };
|
|
|
|
public isChannelFollower(): this is this & {
|
|
|
|
sourceGuild: Guild | APIPartialGuild;
|
|
|
|
sourceChannel: NewsChannel | APIPartialChannel;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export class WebhookClient extends WebhookMixin(BaseClient) {
|
|
|
|
public constructor(data: WebhookClientData, options?: WebhookClientOptions);
|
|
|
|
public client: this;
|
|
|
|
public options: WebhookClientOptions;
|
|
|
|
public token: string;
|
|
|
|
public editMessage(
|
|
|
|
message: MessageResolvable,
|
|
|
|
options: string | MessagePayload | WebhookEditMessageOptions,
|
|
|
|
): Promise<APIMessage>;
|
|
|
|
public fetchMessage(message: Snowflake, options?: WebhookFetchMessageOptions): Promise<APIMessage>;
|
|
|
|
/* tslint:disable:unified-signatures */
|
|
|
|
/** @deprecated */
|
|
|
|
public fetchMessage(message: Snowflake, cache?: boolean): Promise<APIMessage>;
|
|
|
|
/* tslint:enable:unified-signatures */
|
|
|
|
public send(options: string | MessagePayload | WebhookMessageOptions): Promise<APIMessage>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class WebSocketManager extends EventEmitter {
|
|
|
|
private constructor(client: Client);
|
|
|
|
private totalShards: number | string;
|
|
|
|
private shardQueue: Set<WebSocketShard>;
|
|
|
|
private packetQueue: unknown[];
|
|
|
|
private destroyed: boolean;
|
|
|
|
private reconnecting: boolean;
|
|
|
|
|
|
|
|
public readonly client: Client;
|
|
|
|
public gateway: string | null;
|
|
|
|
public shards: Collection<number, WebSocketShard>;
|
|
|
|
public status: Status;
|
|
|
|
public readonly ping: number;
|
|
|
|
|
|
|
|
public on(event: WSEventType, listener: (data: any, shardId: number) => void): this;
|
|
|
|
public once(event: WSEventType, listener: (data: any, shardId: number) => void): this;
|
|
|
|
|
|
|
|
private debug(message: string, shard?: WebSocketShard): void;
|
|
|
|
private connect(): Promise<void>;
|
|
|
|
private createShards(): Promise<void>;
|
|
|
|
private reconnect(): Promise<void>;
|
|
|
|
private broadcast(packet: unknown): void;
|
|
|
|
private destroy(): void;
|
|
|
|
private handlePacket(packet?: unknown, shard?: WebSocketShard): boolean;
|
|
|
|
private checkShardsReady(): void;
|
|
|
|
private triggerClientReady(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WebSocketShardEvents {
|
|
|
|
ready: [];
|
|
|
|
resumed: [];
|
|
|
|
invalidSession: [];
|
2022-07-01 02:59:57 +00:00
|
|
|
destroyed: [];
|
2022-03-19 10:37:45 +00:00
|
|
|
close: [event: CloseEvent];
|
|
|
|
allReady: [unavailableGuilds?: Set<Snowflake>];
|
|
|
|
}
|
|
|
|
|
|
|
|
export class WebSocketShard extends EventEmitter {
|
|
|
|
private constructor(manager: WebSocketManager, id: number);
|
|
|
|
private sequence: number;
|
|
|
|
private closeSequence: number;
|
|
|
|
private sessionId: string | null;
|
2023-01-06 12:05:03 +00:00
|
|
|
private resumeURL: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
private lastPingTimestamp: number;
|
|
|
|
private lastHeartbeatAcked: boolean;
|
|
|
|
private ratelimit: { queue: unknown[]; total: number; remaining: number; time: 60e3; timer: NodeJS.Timeout | null };
|
|
|
|
private connection: WebSocket | null;
|
|
|
|
private helloTimeout: NodeJS.Timeout | null;
|
|
|
|
private eventsAttached: boolean;
|
|
|
|
private expectedGuilds: Set<Snowflake> | null;
|
|
|
|
private readyTimeout: NodeJS.Timeout | null;
|
2022-06-06 04:21:36 +00:00
|
|
|
private closeEmitted: boolean;
|
|
|
|
private wsCloseTimeout: NodeJS.Timeout | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
public manager: WebSocketManager;
|
|
|
|
public id: number;
|
|
|
|
public status: Status;
|
|
|
|
public ping: number;
|
|
|
|
|
|
|
|
private debug(message: string): void;
|
|
|
|
private connect(): Promise<void>;
|
|
|
|
private onOpen(): void;
|
|
|
|
private onMessage(event: MessageEvent): void;
|
|
|
|
private onError(error: ErrorEvent | unknown): void;
|
|
|
|
private onClose(event: CloseEvent): void;
|
|
|
|
private onPacket(packet: unknown): void;
|
|
|
|
private checkReady(): void;
|
|
|
|
private setHelloTimeout(time?: number): void;
|
2022-06-06 04:21:36 +00:00
|
|
|
private setWsCloseTimeout(time?: number): void;
|
2022-03-19 10:37:45 +00:00
|
|
|
private setHeartbeatTimer(time: number): void;
|
|
|
|
private sendHeartbeat(): void;
|
|
|
|
private ackHeartbeat(): void;
|
|
|
|
private identify(): void;
|
|
|
|
private identifyNew(): void;
|
|
|
|
private identifyResume(): void;
|
|
|
|
private _send(data: unknown): void;
|
|
|
|
private processQueue(): void;
|
|
|
|
private destroy(destroyOptions?: { closeCode?: number; reset?: boolean; emit?: boolean; log?: boolean }): void;
|
2022-06-06 04:21:36 +00:00
|
|
|
private emitClose(event?: CloseEvent): void;
|
2022-03-19 10:37:45 +00:00
|
|
|
private _cleanupConnection(): void;
|
|
|
|
private _emitDestroyed(): void;
|
|
|
|
|
|
|
|
public send(data: unknown, important?: boolean): void;
|
|
|
|
|
|
|
|
public on<K extends keyof WebSocketShardEvents>(
|
|
|
|
event: K,
|
|
|
|
listener: (...args: WebSocketShardEvents[K]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
|
|
|
|
public once<K extends keyof WebSocketShardEvents>(
|
|
|
|
event: K,
|
|
|
|
listener: (...args: WebSocketShardEvents[K]) => Awaitable<void>,
|
|
|
|
): this;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Widget extends Base {
|
|
|
|
private constructor(client: Client, data: RawWidgetData);
|
|
|
|
private _patch(data: RawWidgetData): void;
|
|
|
|
public fetch(): Promise<Widget>;
|
|
|
|
public id: Snowflake;
|
2023-01-08 07:28:30 +00:00
|
|
|
public name: string;
|
2022-03-19 10:37:45 +00:00
|
|
|
public instantInvite?: string;
|
|
|
|
public channels: Collection<Snowflake, WidgetChannel>;
|
|
|
|
public members: Collection<string, WidgetMember>;
|
|
|
|
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<APIEmoji, 'animated'>;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public guild: Guild | InviteGuild;
|
|
|
|
public description: string;
|
2022-10-03 12:25:39 +00:00
|
|
|
public readonly channel: TextChannel | NewsChannel | StoreChannel | ForumChannel | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public readonly emoji: GuildEmoji | Emoji;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class WelcomeScreen extends Base {
|
|
|
|
private constructor(guild: Guild, data: RawWelcomeScreenData);
|
|
|
|
public readonly enabled: boolean;
|
|
|
|
public guild: Guild | InviteGuild;
|
|
|
|
public description: string | null;
|
|
|
|
public welcomeChannels: Collection<Snowflake, WelcomeChannel>;
|
|
|
|
}
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region Constants
|
|
|
|
|
|
|
|
export type EnumHolder<T> = { [P in keyof T]: T[P] };
|
|
|
|
|
|
|
|
export type ExcludeEnum<T, K extends keyof T> = Exclude<keyof T | T[keyof T], K | T[K]>;
|
|
|
|
|
|
|
|
export const Constants: {
|
|
|
|
Package: {
|
|
|
|
name: string;
|
|
|
|
version: string;
|
|
|
|
description: string;
|
|
|
|
license: string;
|
|
|
|
main: string;
|
|
|
|
types: string;
|
|
|
|
homepage: string;
|
|
|
|
keywords: string[];
|
|
|
|
bugs: { url: string };
|
|
|
|
repository: { type: string; url: string };
|
|
|
|
scripts: Record<string, string>;
|
|
|
|
engines: Record<string, string>;
|
|
|
|
dependencies: Record<string, string>;
|
|
|
|
devDependencies: Record<string, string>;
|
|
|
|
[key: string]: unknown;
|
|
|
|
};
|
2022-11-26 15:17:33 +00:00
|
|
|
MaxBulkDeletableMessageAge: 1_209_600_000;
|
|
|
|
UserAgent: string;
|
2022-03-19 10:37:45 +00:00
|
|
|
Endpoints: {
|
|
|
|
botGateway: string;
|
|
|
|
invite: (root: string, code: string, eventId?: Snowflake) => string;
|
|
|
|
scheduledEvent: (root: string, guildId: Snowflake, eventId: Snowflake) => string;
|
|
|
|
CDN: (root: string) => {
|
|
|
|
Emoji: (emojiId: Snowflake, format: DynamicImageFormat) => string;
|
|
|
|
Asset: (name: string) => string;
|
|
|
|
DefaultAvatar: (discriminator: number) => string;
|
|
|
|
Avatar: (
|
|
|
|
userId: Snowflake,
|
|
|
|
hash: string,
|
|
|
|
format: DynamicImageFormat,
|
|
|
|
size: AllowedImageSize,
|
|
|
|
dynamic: boolean,
|
|
|
|
) => string;
|
2023-01-06 12:55:37 +00:00
|
|
|
AvatarDecoration: (userId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
|
2022-03-19 10:37:45 +00:00
|
|
|
Banner: (
|
|
|
|
id: Snowflake,
|
|
|
|
hash: string,
|
|
|
|
format: DynamicImageFormat,
|
|
|
|
size: AllowedImageSize,
|
|
|
|
dynamic: boolean,
|
|
|
|
) => string;
|
|
|
|
GuildMemberAvatar: (
|
|
|
|
guildId: Snowflake,
|
|
|
|
memberId: Snowflake,
|
|
|
|
hash: string,
|
|
|
|
format?: DynamicImageFormat,
|
|
|
|
size?: AllowedImageSize,
|
|
|
|
dynamic?: boolean,
|
|
|
|
) => string;
|
|
|
|
Icon: (
|
|
|
|
guildId: Snowflake,
|
|
|
|
hash: string,
|
|
|
|
format: DynamicImageFormat,
|
|
|
|
size: AllowedImageSize,
|
|
|
|
dynamic: boolean,
|
|
|
|
) => string;
|
|
|
|
AppIcon: (
|
|
|
|
appId: Snowflake,
|
|
|
|
hash: string,
|
|
|
|
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
|
|
|
|
) => string;
|
|
|
|
AppAsset: (
|
|
|
|
appId: Snowflake,
|
|
|
|
hash: string,
|
|
|
|
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
|
|
|
|
) => string;
|
|
|
|
StickerPackBanner: (bannerId: Snowflake, format: AllowedImageFormat, size: AllowedImageSize) => string;
|
|
|
|
GDMIcon: (channelId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
|
|
|
|
Splash: (guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
|
|
|
|
DiscoverySplash: (guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
|
|
|
|
TeamIcon: (
|
|
|
|
teamId: Snowflake,
|
|
|
|
hash: string,
|
|
|
|
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
|
|
|
|
) => string;
|
|
|
|
Sticker: (stickerId: Snowflake, stickerFormat: StickerFormatType) => string;
|
|
|
|
RoleIcon: (roleId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
WSCodes: {
|
|
|
|
1000: 'WS_CLOSE_REQUESTED';
|
2022-06-06 04:21:36 +00:00
|
|
|
1011: 'INTERNAL_ERROR';
|
2022-03-19 10:37:45 +00:00
|
|
|
4004: 'TOKEN_INVALID';
|
|
|
|
4010: 'SHARDING_INVALID';
|
|
|
|
4011: 'SHARDING_REQUIRED';
|
2022-06-06 04:21:36 +00:00
|
|
|
4013: 'INVALID_INTENTS';
|
|
|
|
4014: 'DISALLOWED_INTENTS';
|
2022-03-19 10:37:45 +00:00
|
|
|
};
|
|
|
|
Events: ConstantsEvents;
|
|
|
|
ShardEvents: ConstantsShardEvents;
|
|
|
|
PartialTypes: {
|
|
|
|
[K in PartialTypes]: K;
|
|
|
|
};
|
|
|
|
WSEvents: {
|
|
|
|
[K in WSEventType]: K;
|
|
|
|
};
|
|
|
|
Colors: ConstantsColors;
|
|
|
|
Status: ConstantsStatus;
|
|
|
|
Opcodes: ConstantsOpcodes;
|
|
|
|
APIErrors: APIErrors;
|
|
|
|
ChannelTypes: EnumHolder<typeof ChannelTypes>;
|
|
|
|
ThreadChannelTypes: ThreadChannelTypes[];
|
|
|
|
TextBasedChannelTypes: TextBasedChannelTypes[];
|
|
|
|
VoiceBasedChannelTypes: VoiceBasedChannelTypes[];
|
|
|
|
ClientApplicationAssetTypes: ConstantsClientApplicationAssetTypes;
|
|
|
|
IntegrationExpireBehaviors: IntegrationExpireBehaviors[];
|
|
|
|
InviteScopes: InviteScope[];
|
|
|
|
MessageTypes: MessageType[];
|
|
|
|
SystemMessageTypes: SystemMessageType[];
|
|
|
|
ActivityTypes: EnumHolder<typeof ActivityTypes>;
|
|
|
|
StickerTypes: EnumHolder<typeof StickerTypes>;
|
|
|
|
StickerFormatTypes: EnumHolder<typeof StickerFormatTypes>;
|
|
|
|
OverwriteTypes: EnumHolder<typeof OverwriteTypes>;
|
|
|
|
ExplicitContentFilterLevels: EnumHolder<typeof ExplicitContentFilterLevels>;
|
|
|
|
DefaultMessageNotificationLevels: EnumHolder<typeof DefaultMessageNotificationLevels>;
|
|
|
|
VerificationLevels: EnumHolder<typeof VerificationLevels>;
|
|
|
|
MembershipStates: EnumHolder<typeof MembershipStates>;
|
2022-12-20 15:46:50 +00:00
|
|
|
AutoModerationRuleTriggerTypes: EnumHolder<typeof AutoModerationRuleTriggerTypes>;
|
|
|
|
AutoModerationRuleKeywordPresetTypes: EnumHolder<typeof AutoModerationRuleKeywordPresetTypes>;
|
|
|
|
AutoModerationActionTypes: EnumHolder<typeof AutoModerationActionTypes>;
|
|
|
|
AutoModerationRuleEventTypes: EnumHolder<typeof AutoModerationRuleEventTypes>;
|
2022-03-19 10:37:45 +00:00
|
|
|
ApplicationCommandOptionTypes: EnumHolder<typeof ApplicationCommandOptionTypes>;
|
|
|
|
ApplicationCommandPermissionTypes: EnumHolder<typeof ApplicationCommandPermissionTypes>;
|
|
|
|
InteractionTypes: EnumHolder<typeof InteractionTypes>;
|
|
|
|
InteractionResponseTypes: EnumHolder<typeof InteractionResponseTypes>;
|
|
|
|
MessageComponentTypes: EnumHolder<typeof MessageComponentTypes>;
|
2022-12-18 06:17:48 +00:00
|
|
|
SelectMenuComponentTypes: EnumHolder<typeof SelectMenuComponentTypes>;
|
2022-03-19 10:37:45 +00:00
|
|
|
MessageButtonStyles: EnumHolder<typeof MessageButtonStyles>;
|
2022-11-26 15:17:33 +00:00
|
|
|
ModalComponentTypes: EnumHolder<typeof ModalComponentTypes>;
|
|
|
|
TextInputStyles: EnumHolder<typeof TextInputStyles>;
|
2022-03-19 10:37:45 +00:00
|
|
|
MFALevels: EnumHolder<typeof MFALevels>;
|
|
|
|
NSFWLevels: EnumHolder<typeof NSFWLevels>;
|
|
|
|
PrivacyLevels: EnumHolder<typeof PrivacyLevels>;
|
|
|
|
WebhookTypes: EnumHolder<typeof WebhookTypes>;
|
|
|
|
PremiumTiers: EnumHolder<typeof PremiumTiers>;
|
|
|
|
ApplicationCommandTypes: EnumHolder<typeof ApplicationCommandTypes>;
|
|
|
|
GuildScheduledEventEntityTypes: EnumHolder<typeof GuildScheduledEventEntityTypes>;
|
|
|
|
GuildScheduledEventStatuses: EnumHolder<typeof GuildScheduledEventStatuses>;
|
|
|
|
GuildScheduledEventPrivacyLevels: EnumHolder<typeof GuildScheduledEventPrivacyLevels>;
|
2022-11-26 15:17:33 +00:00
|
|
|
VideoQualityModes: EnumHolder<typeof VideoQualityModes>;
|
|
|
|
SweeperKeys: SweeperKey[];
|
|
|
|
// Add
|
2023-02-09 12:26:39 +00:00
|
|
|
defaultUA: string;
|
2022-12-04 09:38:15 +00:00
|
|
|
captchaServices: captchaServices[];
|
2022-11-26 15:17:33 +00:00
|
|
|
DMScanLevel: EnumHolder<typeof DMScanLevel>;
|
|
|
|
stickerAnimationMode: EnumHolder<typeof stickerAnimationMode>;
|
|
|
|
NitroType: EnumHolder<typeof NitroTypes>;
|
|
|
|
HypeSquadType: EnumHolder<typeof HypeSquadTypes>;
|
|
|
|
localeSetting: EnumHolder<typeof localeSettings>;
|
|
|
|
userGateway: string;
|
2022-03-19 10:37:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const version: string;
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region Managers
|
|
|
|
|
|
|
|
export abstract class BaseManager {
|
|
|
|
protected constructor(client: Client);
|
|
|
|
public readonly client: Client;
|
|
|
|
}
|
|
|
|
|
|
|
|
export abstract class DataManager<K, Holds, R> extends BaseManager {
|
|
|
|
protected constructor(client: Client, holds: Constructable<Holds>);
|
|
|
|
public readonly holds: Constructable<Holds>;
|
|
|
|
public readonly cache: Collection<K, Holds>;
|
|
|
|
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<K, Holds>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export abstract class CachedManager<K, Holds, R> extends DataManager<K, Holds, R> {
|
|
|
|
protected constructor(client: Client, holds: Constructable<Holds>);
|
2023-04-02 05:46:18 +00:00
|
|
|
private readonly _cache: Collection<K, Holds>;
|
2022-03-19 10:37:45 +00:00
|
|
|
private _add(data: unknown, cache?: boolean, { id, extras }?: { id: K; extras: unknown[] }): Holds;
|
|
|
|
}
|
|
|
|
|
2022-07-06 12:40:11 +00:00
|
|
|
export type ApplicationCommandDataResolvable =
|
|
|
|
| ApplicationCommandData
|
|
|
|
| RESTPostAPIApplicationCommandsJSONBody
|
|
|
|
| SlashCommandBuilder
|
|
|
|
| ContextMenuCommandBuilder;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export class ApplicationCommandManager<
|
|
|
|
ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>,
|
|
|
|
PermissionsOptionsExtras = { guild: GuildResolvable },
|
|
|
|
PermissionsGuildType = null,
|
2022-06-04 07:00:20 +00:00
|
|
|
> extends CachedManager<Snowflake, ApplicationCommandScope, ApplicationCommandResolvable> {
|
2022-06-04 06:26:53 +00:00
|
|
|
// @ts-ignore
|
2022-03-25 15:57:21 +00:00
|
|
|
protected constructor(client: Client, iterable?: Iterable<unknown>, user: User);
|
2022-03-19 10:37:45 +00:00
|
|
|
public permissions: ApplicationCommandPermissionsManager<
|
|
|
|
{ command?: ApplicationCommandResolvable } & PermissionsOptionsExtras,
|
|
|
|
{ command: ApplicationCommandResolvable } & PermissionsOptionsExtras,
|
|
|
|
PermissionsOptionsExtras,
|
|
|
|
PermissionsGuildType,
|
|
|
|
null
|
|
|
|
>;
|
|
|
|
private commandPath({ id, guildId }: { id?: Snowflake; guildId?: Snowflake }): unknown;
|
|
|
|
public create(command: ApplicationCommandDataResolvable, guildId?: Snowflake): Promise<ApplicationCommandScope>;
|
|
|
|
public delete(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise<ApplicationCommandScope | null>;
|
|
|
|
public edit(
|
|
|
|
command: ApplicationCommandResolvable,
|
2022-06-24 02:14:55 +00:00
|
|
|
data: Partial<ApplicationCommandDataResolvable>,
|
2022-03-19 10:37:45 +00:00
|
|
|
): Promise<ApplicationCommandScope>;
|
|
|
|
public edit(
|
|
|
|
command: ApplicationCommandResolvable,
|
2022-06-24 02:14:55 +00:00
|
|
|
data: Partial<ApplicationCommandDataResolvable>,
|
2022-03-19 10:37:45 +00:00
|
|
|
guildId: Snowflake,
|
|
|
|
): Promise<ApplicationCommand>;
|
|
|
|
public fetch(
|
|
|
|
id: Snowflake,
|
|
|
|
options: FetchApplicationCommandOptions & { guildId: Snowflake },
|
|
|
|
): Promise<ApplicationCommand>;
|
|
|
|
public fetch(options: FetchApplicationCommandOptions): Promise<Collection<string, ApplicationCommandScope>>;
|
|
|
|
public fetch(id: Snowflake, options?: FetchApplicationCommandOptions): Promise<ApplicationCommandScope>;
|
|
|
|
public fetch(
|
|
|
|
id?: Snowflake,
|
|
|
|
options?: FetchApplicationCommandOptions,
|
|
|
|
): Promise<Collection<Snowflake, ApplicationCommandScope>>;
|
|
|
|
public set(commands: ApplicationCommandDataResolvable[]): Promise<Collection<Snowflake, ApplicationCommandScope>>;
|
|
|
|
public set(
|
|
|
|
commands: ApplicationCommandDataResolvable[],
|
|
|
|
guildId: Snowflake,
|
|
|
|
): Promise<Collection<Snowflake, ApplicationCommand>>;
|
2022-07-06 12:40:11 +00:00
|
|
|
private static transformCommand(command: ApplicationCommandDataResolvable): RESTPostAPIApplicationCommandsJSONBody;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class ApplicationCommandPermissionsManager<
|
|
|
|
BaseOptions,
|
|
|
|
FetchSingleOptions,
|
|
|
|
FullPermissionsOptions,
|
|
|
|
GuildType,
|
|
|
|
CommandIdType,
|
2022-04-16 10:44:43 +00:00
|
|
|
> extends BaseManager {
|
|
|
|
private constructor(
|
|
|
|
manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand,
|
|
|
|
user: User,
|
|
|
|
);
|
2022-03-19 10:37:45 +00:00
|
|
|
private manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand;
|
|
|
|
|
|
|
|
public client: Client;
|
|
|
|
public commandId: CommandIdType;
|
|
|
|
public guild: GuildType;
|
|
|
|
public guildId: Snowflake | null;
|
|
|
|
public add(
|
|
|
|
options: FetchSingleOptions & { permissions: ApplicationCommandPermissionData[] },
|
|
|
|
): Promise<ApplicationCommandPermissions[]>;
|
|
|
|
public has(options: FetchSingleOptions & { permissionId: UserResolvable | RoleResolvable }): Promise<boolean>;
|
|
|
|
public fetch(options: FetchSingleOptions): Promise<ApplicationCommandPermissions[]>;
|
|
|
|
public fetch(options: BaseOptions): Promise<Collection<Snowflake, ApplicationCommandPermissions[]>>;
|
|
|
|
public remove(
|
|
|
|
options:
|
|
|
|
| (FetchSingleOptions & {
|
2022-04-16 10:44:43 +00:00
|
|
|
users: UserResolvable | UserResolvable[];
|
|
|
|
roles?: RoleResolvable | RoleResolvable[];
|
|
|
|
})
|
2022-03-19 10:37:45 +00:00
|
|
|
| (FetchSingleOptions & {
|
2022-04-16 10:44:43 +00:00
|
|
|
users?: UserResolvable | UserResolvable[];
|
|
|
|
roles: RoleResolvable | RoleResolvable[];
|
|
|
|
}),
|
2022-03-19 10:37:45 +00:00
|
|
|
): Promise<ApplicationCommandPermissions[]>;
|
|
|
|
public set(
|
|
|
|
options: FetchSingleOptions & { permissions: ApplicationCommandPermissionData[] },
|
|
|
|
): Promise<ApplicationCommandPermissions[]>;
|
|
|
|
public set(
|
|
|
|
options: FullPermissionsOptions & {
|
|
|
|
fullPermissions: GuildApplicationCommandPermissionData[];
|
|
|
|
},
|
|
|
|
): Promise<Collection<Snowflake, ApplicationCommandPermissions[]>>;
|
|
|
|
private permissionsPath(guildId: Snowflake, commandId?: Snowflake): unknown;
|
|
|
|
private static transformPermissions(
|
|
|
|
permissions: ApplicationCommandPermissionData,
|
|
|
|
received: true,
|
|
|
|
): Omit<APIApplicationCommandPermission, 'type'> & { type: keyof ApplicationCommandPermissionTypes };
|
|
|
|
private static transformPermissions(permissions: ApplicationCommandPermissionData): APIApplicationCommandPermission;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BaseGuildEmojiManager extends CachedManager<Snowflake, GuildEmoji, EmojiResolvable> {
|
|
|
|
protected constructor(client: Client, iterable?: Iterable<RawGuildEmojiData>);
|
|
|
|
public resolveIdentifier(emoji: EmojiIdentifierResolvable): string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ChannelManager extends CachedManager<Snowflake, AnyChannel, ChannelResolvable> {
|
|
|
|
private constructor(client: Client, iterable: Iterable<RawChannelData>);
|
|
|
|
public fetch(id: Snowflake, options?: FetchChannelOptions): Promise<AnyChannel | null>;
|
2022-08-19 11:16:11 +00:00
|
|
|
public createGroupDM(recipients: UserResolvable[]): Promise<PartialGroupDMChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type FetchGuildApplicationCommandFetchOptions = Omit<FetchApplicationCommandOptions, 'guildId'>;
|
|
|
|
|
2022-08-20 13:26:56 +00:00
|
|
|
export class GuildFolderManager extends BaseManager {
|
|
|
|
private constructor(client: Client);
|
|
|
|
public cache: Collection<number, GuildFolder>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RawGuildFolderData {
|
|
|
|
id: number | null;
|
|
|
|
name: string | null;
|
|
|
|
guild_ids: Snowflake[];
|
|
|
|
color: number | null;
|
2022-07-17 10:52:28 +00:00
|
|
|
}
|
2022-08-20 13:26:56 +00:00
|
|
|
export class GuildFolder extends Base {
|
|
|
|
private constructor(client: Client, data: RawGuildFolderData);
|
|
|
|
public id: number | null;
|
|
|
|
public name: string | null;
|
|
|
|
public guild_ids: Snowflake[];
|
|
|
|
public color: number | null;
|
|
|
|
public readonly hexColor: string | null;
|
|
|
|
public readonly guilds: Collection<Snowflake, Guild>;
|
|
|
|
public toJSON(): RawGuildFolderData;
|
|
|
|
}
|
|
|
|
|
2023-01-08 07:06:42 +00:00
|
|
|
export class ClientUserSettingManager extends BaseManager {
|
2022-04-16 15:56:18 +00:00
|
|
|
private constructor(client: Client);
|
2022-04-14 14:32:11 +00:00
|
|
|
public rawSetting: RawUserSettingsData | object;
|
|
|
|
public locale: localeSetting | null;
|
|
|
|
public activityDisplay: boolean | null;
|
|
|
|
public DMfromServerMode: boolean | null;
|
|
|
|
public displayImage: boolean | null;
|
|
|
|
public linkedImageDisplay: boolean | null;
|
|
|
|
public autoplayGIF: boolean | null;
|
|
|
|
public previewLink: boolean | null;
|
|
|
|
public animatedEmojis: boolean | null;
|
|
|
|
public allowTTS: boolean | null;
|
|
|
|
public compactMode: boolean | null;
|
|
|
|
public convertEmoticons: boolean | null;
|
|
|
|
public DMScanLevel: DMScanLevel;
|
|
|
|
public theme: 'dark' | 'light' | null;
|
|
|
|
public developerMode: boolean | null;
|
|
|
|
public afkTimeout: number | null; // second
|
|
|
|
public stickerAnimationMode: stickerAnimationMode;
|
|
|
|
public showEmojiReactions: boolean | null;
|
2022-04-16 10:44:43 +00:00
|
|
|
public customStatus:
|
|
|
|
| {
|
|
|
|
text?: string;
|
|
|
|
expires_at?: string | null;
|
|
|
|
emoji_name?: string;
|
|
|
|
emoji_id?: Snowflake | null;
|
|
|
|
status?: PresenceStatusData;
|
|
|
|
}
|
|
|
|
| object;
|
|
|
|
public addFriendFrom: { all?: boolean; mutual_friends?: boolean; mututal_guilds?: boolean } | object;
|
2022-08-20 13:26:56 +00:00
|
|
|
public guildFolder: GuildFolderManager;
|
2022-04-14 14:32:11 +00:00
|
|
|
public disableDMfromServer: Collection<Snowflake, boolean>;
|
|
|
|
public fetch(): Promise<RawUserSettingsData>;
|
2023-01-08 07:06:42 +00:00
|
|
|
public edit(data: Partial<RawUserSettingsData>): Promise<this>;
|
2022-06-04 06:26:53 +00:00
|
|
|
public setDisplayCompactMode(value?: boolean): Promise<this>;
|
|
|
|
public setTheme(value?: 'dark' | 'light'): Promise<this>;
|
|
|
|
public setLocale(value: localeSetting): Promise<this>;
|
|
|
|
// @ts-ignore
|
2022-08-20 13:26:56 +00:00
|
|
|
public setCustomStatus(value?: CustomStatusOption | CustomStatus): Promise<this>;
|
2022-06-04 06:26:53 +00:00
|
|
|
public restrictedGuilds(status: boolean): Promise<void>;
|
|
|
|
public addRestrictedGuild(guildId: GuildResolvable): Promise<void>;
|
|
|
|
public removeRestrictedGuild(guildId: GuildResolvable): Promise<void>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2023-01-08 07:06:42 +00:00
|
|
|
export class GuildSettingManager extends BaseManager {
|
|
|
|
private constructor(client: Client, guildId: Snowflake);
|
|
|
|
public rawSetting?: RawGuildSettingsData;
|
|
|
|
public suppressEveryone?: boolean;
|
|
|
|
public suppressRoles?: boolean;
|
|
|
|
public muteScheduledEvents?: boolean;
|
|
|
|
public messageNotifications?: number;
|
|
|
|
public flags?: number;
|
|
|
|
public mobilePush?: boolean;
|
|
|
|
public muted?: boolean;
|
|
|
|
public muteConfig?: MuteConfigData;
|
|
|
|
public hideMutedChannels?: boolean;
|
|
|
|
public channelOverrides?: object[];
|
|
|
|
public notifyHighlights?: number;
|
|
|
|
public version?: number;
|
|
|
|
public guildId?: Snowflake;
|
|
|
|
public readonly guild?: Guild;
|
|
|
|
public edit(data: Partial<RawGuildSettingsData>): Promise<this>;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class GuildApplicationCommandManager extends ApplicationCommandManager<ApplicationCommand, {}, Guild> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawApplicationCommandData>);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(command: ApplicationCommandDataResolvable): Promise<ApplicationCommand>;
|
|
|
|
public delete(command: ApplicationCommandResolvable): Promise<ApplicationCommand | null>;
|
|
|
|
public edit(
|
|
|
|
command: ApplicationCommandResolvable,
|
2022-07-06 12:40:11 +00:00
|
|
|
data: Partial<ApplicationCommandDataResolvable>,
|
2022-03-19 10:37:45 +00:00
|
|
|
): Promise<ApplicationCommand>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public fetch(id: Snowflake, options?: FetchGuildApplicationCommandFetchOptions): Promise<ApplicationCommand>;
|
|
|
|
public fetch(options: FetchGuildApplicationCommandFetchOptions): Promise<Collection<Snowflake, ApplicationCommand>>;
|
|
|
|
public fetch(
|
|
|
|
id?: undefined,
|
|
|
|
options?: FetchGuildApplicationCommandFetchOptions,
|
|
|
|
): Promise<Collection<Snowflake, ApplicationCommand>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public set(commands: ApplicationCommandDataResolvable[]): Promise<Collection<Snowflake, ApplicationCommand>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MappedGuildChannelTypes = EnumValueMapped<
|
|
|
|
typeof ChannelTypes,
|
|
|
|
{
|
|
|
|
GUILD_CATEGORY: CategoryChannel;
|
|
|
|
}
|
|
|
|
> &
|
|
|
|
MappedChannelCategoryTypes;
|
|
|
|
|
|
|
|
export type GuildChannelTypes = CategoryChannelTypes | ChannelTypes.GUILD_CATEGORY | 'GUILD_CATEGORY';
|
|
|
|
|
|
|
|
export class GuildChannelManager extends CachedManager<Snowflake, GuildBasedChannel, GuildChannelResolvable> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawGuildChannelData>);
|
|
|
|
public readonly channelCountWithoutThreads: number;
|
|
|
|
public guild: Guild;
|
2022-05-14 08:06:15 +00:00
|
|
|
|
|
|
|
public create<T extends Exclude<GuildChannelTypes, 'GUILD_STORE' | ChannelTypes.GUILD_STORE>>(
|
2022-03-19 10:37:45 +00:00
|
|
|
name: string,
|
|
|
|
options: GuildChannelCreateOptions & { type: T },
|
|
|
|
): Promise<MappedGuildChannelTypes[T]>;
|
2022-05-14 08:06:15 +00:00
|
|
|
|
2022-08-14 10:17:37 +00:00
|
|
|
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647) for more information */
|
2022-05-14 08:06:15 +00:00
|
|
|
public create(
|
|
|
|
name: string,
|
|
|
|
options: GuildChannelCreateOptions & { type: 'GUILD_STORE' | ChannelTypes.GUILD_STORE },
|
|
|
|
): Promise<StoreChannel>;
|
|
|
|
public create(name: string, options?: GuildChannelCreateOptions): Promise<TextChannel>;
|
|
|
|
public createWebhook(
|
|
|
|
channel: GuildChannelResolvable,
|
|
|
|
name: string,
|
2023-04-15 12:53:43 +00:00
|
|
|
options?: TextChannel | NewsChannel | VoiceChannel | StageChannel | ForumChannel | Snowflake,
|
2022-05-14 08:06:15 +00:00
|
|
|
): Promise<Webhook>;
|
2023-02-21 07:25:40 +00:00
|
|
|
public addFollower(
|
|
|
|
channel: NewsChannel | Snowflake,
|
|
|
|
targetChannel: TextChannelResolvable,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<Snowflake>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public edit(channel: GuildChannelResolvable, data: ChannelData, reason?: string): Promise<GuildChannel>;
|
2022-09-14 10:47:37 +00:00
|
|
|
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<GuildBasedChannel | null>;
|
|
|
|
public fetch(
|
|
|
|
id?: undefined,
|
|
|
|
options?: BaseFetchOptions,
|
|
|
|
): Promise<Collection<Snowflake, NonThreadGuildBasedChannel | null>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public fetchWebhooks(channel: GuildChannelResolvable): Promise<Collection<Snowflake, Webhook>>;
|
|
|
|
public setPosition(
|
|
|
|
channel: GuildChannelResolvable,
|
|
|
|
position: number,
|
|
|
|
options?: SetChannelPositionOptions,
|
|
|
|
): Promise<GuildChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public setPositions(channelPositions: readonly ChannelPosition[]): Promise<Guild>;
|
|
|
|
public fetchActiveThreads(cache?: boolean): Promise<FetchedThreads>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public delete(channel: GuildChannelResolvable, reason?: string): Promise<void>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildEmojiManager extends BaseGuildEmojiManager {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawGuildEmojiData>);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(
|
|
|
|
attachment: BufferResolvable | Base64Resolvable,
|
|
|
|
name: string,
|
|
|
|
options?: GuildEmojiCreateOptions,
|
|
|
|
): Promise<GuildEmoji>;
|
|
|
|
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<GuildEmoji>;
|
|
|
|
public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, GuildEmoji>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public fetchAuthor(emoji: EmojiResolvable): Promise<User>;
|
|
|
|
public delete(emoji: EmojiResolvable, reason?: string): Promise<void>;
|
|
|
|
public edit(emoji: EmojiResolvable, data: GuildEmojiEditData, reason?: string): Promise<GuildEmoji>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildEmojiRoleManager extends DataManager<Snowflake, Role, RoleResolvable> {
|
|
|
|
private constructor(emoji: GuildEmoji);
|
|
|
|
public emoji: GuildEmoji;
|
|
|
|
public guild: Guild;
|
|
|
|
public add(
|
|
|
|
roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>,
|
|
|
|
): Promise<GuildEmoji>;
|
|
|
|
public set(roles: readonly RoleResolvable[] | Collection<Snowflake, Role>): Promise<GuildEmoji>;
|
|
|
|
public remove(
|
|
|
|
roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>,
|
|
|
|
): Promise<GuildEmoji>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildManager extends CachedManager<Snowflake, Guild, GuildResolvable> {
|
|
|
|
private constructor(client: Client, iterable?: Iterable<RawGuildData>);
|
|
|
|
public create(name: string, options?: GuildCreateOptions): Promise<Guild>;
|
|
|
|
public fetch(options: Snowflake | FetchGuildOptions): Promise<Guild>;
|
|
|
|
public fetch(options?: FetchGuildsOptions): Promise<Collection<Snowflake, OAuth2Guild>>;
|
|
|
|
}
|
|
|
|
|
2022-08-31 04:04:42 +00:00
|
|
|
export interface BruteforceOptions {
|
2023-03-29 11:38:43 +00:00
|
|
|
limit?: number;
|
|
|
|
delay?: number;
|
|
|
|
depth?: number;
|
2022-08-31 04:04:42 +00:00
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export class GuildMemberManager extends CachedManager<Snowflake, GuildMember, GuildMemberResolvable> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawGuildMemberData>);
|
|
|
|
public guild: Guild;
|
2023-01-10 11:08:05 +00:00
|
|
|
public readonly me: GuildMember | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public add(
|
|
|
|
user: UserResolvable,
|
|
|
|
options: AddGuildMemberOptions & { fetchWhenExisting: false },
|
|
|
|
): Promise<GuildMember | null>;
|
|
|
|
public add(user: UserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
|
|
|
|
public ban(user: UserResolvable, options?: BanOptions): Promise<GuildMember | User | Snowflake>;
|
2022-07-04 05:17:37 +00:00
|
|
|
public edit(user: UserResolvable, data: GuildMemberEditData, reason?: string): Promise<GuildMember>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetch(
|
|
|
|
options: UserResolvable | FetchMemberOptions | (FetchMembersOptions & { user: UserResolvable }),
|
|
|
|
): Promise<GuildMember>;
|
|
|
|
public fetch(options?: FetchMembersOptions): Promise<Collection<Snowflake, GuildMember>>;
|
2022-08-31 04:04:42 +00:00
|
|
|
public fetchMemberList(
|
|
|
|
channel: GuildTextChannelResolvable,
|
|
|
|
offset?: number,
|
2022-11-23 15:09:24 +00:00
|
|
|
double?: boolean,
|
|
|
|
retryMax?: number,
|
2022-08-31 04:04:42 +00:00
|
|
|
time?: number,
|
|
|
|
): Promise<Collection<Snowflake, GuildMember>>;
|
2022-09-04 11:31:39 +00:00
|
|
|
public fetchBruteforce(options?: BruteforceOptions): Promise<Collection<Snowflake, GuildMember>>;
|
2023-01-10 11:08:05 +00:00
|
|
|
public fetchMe(options?: BaseFetchOptions): Promise<GuildMember>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public kick(user: UserResolvable, reason?: string): Promise<GuildMember | User | Snowflake>;
|
|
|
|
public list(options?: GuildListMembersOptions): Promise<Collection<Snowflake, GuildMember>>;
|
|
|
|
public prune(options: GuildPruneMembersOptions & { dry?: false; count: false }): Promise<null>;
|
|
|
|
public prune(options?: GuildPruneMembersOptions): Promise<number>;
|
|
|
|
public search(options: GuildSearchMembersOptions): Promise<Collection<Snowflake, GuildMember>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public unban(user: UserResolvable, reason?: string): Promise<User | null>;
|
2023-02-22 05:01:29 +00:00
|
|
|
public addRole(user: UserResolvable, role: RoleResolvable, reason?: string): Promise<GuildMember | User | Snowflake>;
|
|
|
|
public removeRole(
|
|
|
|
user: UserResolvable,
|
|
|
|
role: RoleResolvable,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<GuildMember | User | Snowflake>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildBanManager extends CachedManager<Snowflake, GuildBan, GuildBanResolvable> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawGuildBanData>);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(user: UserResolvable, options?: BanOptions): Promise<GuildMember | User | Snowflake>;
|
|
|
|
public fetch(options: UserResolvable | FetchBanOptions): Promise<GuildBan>;
|
|
|
|
public fetch(options?: FetchBansOptions): Promise<Collection<Snowflake, GuildBan>>;
|
|
|
|
public remove(user: UserResolvable, reason?: string): Promise<User | null>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildInviteManager extends DataManager<string, Invite, InviteResolvable> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawInviteData>);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(channel: GuildInvitableChannelResolvable, options?: CreateInviteOptions): Promise<Invite>;
|
|
|
|
public fetch(options: InviteResolvable | FetchInviteOptions): Promise<Invite>;
|
|
|
|
public fetch(options?: FetchInvitesOptions): Promise<Collection<string, Invite>>;
|
|
|
|
public delete(invite: InviteResolvable, reason?: string): Promise<Invite>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildScheduledEventManager extends CachedManager<
|
|
|
|
Snowflake,
|
|
|
|
GuildScheduledEvent,
|
|
|
|
GuildScheduledEventResolvable
|
|
|
|
> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawGuildScheduledEventData>);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(options: GuildScheduledEventCreateOptions): Promise<GuildScheduledEvent>;
|
|
|
|
public fetch(): Promise<Collection<Snowflake, GuildScheduledEvent>>;
|
|
|
|
public fetch<
|
|
|
|
T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions | FetchGuildScheduledEventsOptions,
|
2022-04-16 10:44:43 +00:00
|
|
|
>(options?: T): Promise<GuildScheduledEventManagerFetchResult<T>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public edit<S extends GuildScheduledEventStatus, T extends GuildScheduledEventSetStatusArg<S>>(
|
|
|
|
guildScheduledEvent: GuildScheduledEventResolvable,
|
|
|
|
options: GuildScheduledEventEditOptions<S, T>,
|
|
|
|
): Promise<GuildScheduledEvent<T>>;
|
|
|
|
public delete(guildScheduledEvent: GuildScheduledEventResolvable): Promise<void>;
|
|
|
|
public fetchSubscribers<T extends FetchGuildScheduledEventSubscribersOptions>(
|
|
|
|
guildScheduledEvent: GuildScheduledEventResolvable,
|
|
|
|
options?: T,
|
|
|
|
): Promise<GuildScheduledEventManagerFetchSubscribersResult<T>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildStickerManager extends CachedManager<Snowflake, Sticker, StickerResolvable> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawStickerData>);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(
|
|
|
|
file: BufferResolvable | Stream | FileOptions | MessageAttachment,
|
|
|
|
name: string,
|
|
|
|
tags: string,
|
|
|
|
options?: GuildStickerCreateOptions,
|
|
|
|
): Promise<Sticker>;
|
|
|
|
public edit(sticker: StickerResolvable, data?: GuildStickerEditData, reason?: string): Promise<Sticker>;
|
|
|
|
public delete(sticker: StickerResolvable, reason?: string): Promise<void>;
|
|
|
|
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<Sticker>;
|
|
|
|
public fetch(id?: Snowflake, options?: BaseFetchOptions): Promise<Collection<Snowflake, Sticker>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public fetchUser(sticker: StickerResolvable): Promise<User | null>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildMemberRoleManager extends DataManager<Snowflake, Role, RoleResolvable> {
|
|
|
|
private constructor(member: GuildMember);
|
|
|
|
public readonly hoist: Role | null;
|
|
|
|
public readonly icon: Role | null;
|
|
|
|
public readonly color: Role | null;
|
|
|
|
public readonly highest: Role;
|
|
|
|
public readonly premiumSubscriberRole: Role | null;
|
|
|
|
public readonly botRole: Role | null;
|
|
|
|
public member: GuildMember;
|
|
|
|
public guild: Guild;
|
|
|
|
|
|
|
|
public add(
|
|
|
|
roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<GuildMember>;
|
|
|
|
public set(roles: readonly RoleResolvable[] | Collection<Snowflake, Role>, reason?: string): Promise<GuildMember>;
|
|
|
|
public remove(
|
|
|
|
roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<GuildMember>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MessageManager extends CachedManager<Snowflake, Message, MessageResolvable> {
|
|
|
|
private constructor(channel: TextBasedChannel, iterable?: Iterable<RawMessageData>);
|
|
|
|
public channel: TextBasedChannel;
|
|
|
|
public cache: Collection<Snowflake, Message>;
|
|
|
|
public crosspost(message: MessageResolvable): Promise<Message>;
|
|
|
|
public delete(message: MessageResolvable): Promise<void>;
|
|
|
|
public edit(message: MessageResolvable, options: string | MessagePayload | MessageEditOptions): Promise<Message>;
|
|
|
|
public fetch(message: Snowflake, options?: BaseFetchOptions): Promise<Message>;
|
|
|
|
public fetch(
|
|
|
|
options?: ChannelLogsQueryOptions,
|
|
|
|
cacheOptions?: BaseFetchOptions,
|
|
|
|
): Promise<Collection<Snowflake, Message>>;
|
|
|
|
public fetchPinned(cache?: boolean): Promise<Collection<Snowflake, Message>>;
|
|
|
|
public react(message: MessageResolvable, emoji: EmojiIdentifierResolvable): Promise<void>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public pin(message: MessageResolvable, reason?: string): Promise<void>;
|
|
|
|
public unpin(message: MessageResolvable, reason?: string): Promise<void>;
|
2022-06-15 16:07:24 +00:00
|
|
|
public search(options: MessageSearchOptions): Promise<MessageSearchResult>;
|
|
|
|
}
|
|
|
|
|
2022-10-09 12:37:04 +00:00
|
|
|
export class InteractionManager extends CachedManager<Snowflake, Message, MessageResolvable> {
|
|
|
|
private constructor(channel: TextBasedChannel, iterable?: Iterable<RawMessageData>);
|
|
|
|
public channel: TextBasedChannel;
|
|
|
|
public cache: Collection<Snowflake, Message>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class InteractionResponse extends Base {
|
2022-10-09 12:45:45 +00:00
|
|
|
private constructor(client: Client, data: object);
|
2022-10-09 12:37:04 +00:00
|
|
|
public readonly channel: GuildTextBasedChannel | TextBasedChannel;
|
|
|
|
public channelId: Snowflake;
|
|
|
|
public readonly createdAt: Date;
|
|
|
|
public createdTimestamp: number;
|
|
|
|
public guildId: Snowflake | null;
|
|
|
|
public readonly guild: Snowflake | null;
|
|
|
|
public id: Snowflake;
|
|
|
|
public nonce: Snowflake;
|
2022-10-09 12:45:45 +00:00
|
|
|
public sendData: object;
|
2022-12-12 12:28:13 +00:00
|
|
|
public awaitModal(time: number): Modal;
|
2022-10-09 12:37:04 +00:00
|
|
|
}
|
|
|
|
|
2022-06-15 16:07:24 +00:00
|
|
|
export interface MessageSearchOptions {
|
2023-04-28 12:46:37 +00:00
|
|
|
authors: UserResolvable[];
|
2022-06-15 16:07:24 +00:00
|
|
|
content: string;
|
2023-04-28 12:46:37 +00:00
|
|
|
mentions: UserResolvable[];
|
2022-06-15 16:07:24 +00:00
|
|
|
has: ('link' | 'embed' | 'file' | 'video' | 'image' | 'sound' | 'sticker')[];
|
|
|
|
maxId: Snowflake;
|
|
|
|
minId: Snowflake;
|
2023-04-28 12:46:37 +00:00
|
|
|
channels: TextChannelResolvable[];
|
2022-06-15 16:07:24 +00:00
|
|
|
pinned: boolean;
|
2022-07-15 14:35:23 +00:00
|
|
|
nsfw: boolean;
|
2022-07-17 15:26:50 +00:00
|
|
|
offset: number;
|
|
|
|
limit: number;
|
2023-04-28 12:46:37 +00:00
|
|
|
sortBy: 'relevant' | 'timestamp';
|
|
|
|
sortOrder: 'asc' | 'desc';
|
2022-06-15 16:07:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageSearchResult {
|
|
|
|
messages: Collection<Snowflake, Message>;
|
|
|
|
total: number;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class PermissionOverwriteManager extends CachedManager<
|
|
|
|
Snowflake,
|
|
|
|
PermissionOverwrites,
|
|
|
|
PermissionOverwriteResolvable
|
|
|
|
> {
|
|
|
|
private constructor(client: Client, iterable?: Iterable<RawPermissionOverwriteData>);
|
|
|
|
public set(
|
|
|
|
overwrites: readonly OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<NonThreadGuildBasedChannel>;
|
|
|
|
private upsert(
|
|
|
|
userOrRole: RoleResolvable | UserResolvable,
|
|
|
|
options: PermissionOverwriteOptions,
|
|
|
|
overwriteOptions?: GuildChannelOverwriteOptions,
|
|
|
|
existing?: PermissionOverwrites,
|
|
|
|
): Promise<NonThreadGuildBasedChannel>;
|
|
|
|
public create(
|
|
|
|
userOrRole: RoleResolvable | UserResolvable,
|
|
|
|
options: PermissionOverwriteOptions,
|
|
|
|
overwriteOptions?: GuildChannelOverwriteOptions,
|
|
|
|
): Promise<NonThreadGuildBasedChannel>;
|
|
|
|
public edit(
|
|
|
|
userOrRole: RoleResolvable | UserResolvable,
|
|
|
|
options: PermissionOverwriteOptions,
|
|
|
|
overwriteOptions?: GuildChannelOverwriteOptions,
|
|
|
|
): Promise<NonThreadGuildBasedChannel>;
|
|
|
|
public delete(userOrRole: RoleResolvable | UserResolvable, reason?: string): Promise<NonThreadGuildBasedChannel>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class PresenceManager extends CachedManager<Snowflake, Presence, PresenceResolvable> {
|
|
|
|
private constructor(client: Client, iterable?: Iterable<RawPresenceData>);
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ReactionManager extends CachedManager<Snowflake | string, MessageReaction, MessageReactionResolvable> {
|
|
|
|
private constructor(message: Message, iterable?: Iterable<RawMessageReactionData>);
|
|
|
|
public message: Message;
|
|
|
|
public removeAll(): Promise<Message>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ReactionUserManager extends CachedManager<Snowflake, User, UserResolvable> {
|
|
|
|
private constructor(reaction: MessageReaction, iterable?: Iterable<RawUserData>);
|
|
|
|
public reaction: MessageReaction;
|
|
|
|
public fetch(options?: FetchReactionUsersOptions): Promise<Collection<Snowflake, User>>;
|
|
|
|
public remove(user?: UserResolvable): Promise<MessageReaction>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class RoleManager extends CachedManager<Snowflake, Role, RoleResolvable> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawRoleData>);
|
|
|
|
public readonly everyone: Role;
|
|
|
|
public readonly highest: Role;
|
|
|
|
public guild: Guild;
|
|
|
|
public readonly premiumSubscriberRole: Role | null;
|
|
|
|
public botRoleFor(user: UserResolvable): Role | null;
|
|
|
|
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<Role | null>;
|
|
|
|
public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, Role>>;
|
|
|
|
public create(options?: CreateRoleOptions): Promise<Role>;
|
|
|
|
public edit(role: RoleResolvable, options: RoleData, reason?: string): Promise<Role>;
|
|
|
|
public delete(role: RoleResolvable, reason?: string): Promise<void>;
|
2022-05-14 08:06:15 +00:00
|
|
|
public setPosition(role: RoleResolvable, position: number, options?: SetRolePositionOptions): Promise<Role>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public comparePositions(role1: RoleResolvable, role2: RoleResolvable): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class StageInstanceManager extends CachedManager<Snowflake, StageInstance, StageInstanceResolvable> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawStageInstanceData>);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(channel: StageChannelResolvable, options: StageInstanceCreateOptions): Promise<StageInstance>;
|
|
|
|
public fetch(channel: StageChannelResolvable, options?: BaseFetchOptions): Promise<StageInstance>;
|
|
|
|
public edit(channel: StageChannelResolvable, options: StageInstanceEditOptions): Promise<StageInstance>;
|
|
|
|
public delete(channel: StageChannelResolvable): Promise<void>;
|
|
|
|
}
|
|
|
|
|
2022-10-03 12:25:39 +00:00
|
|
|
export class ThreadManager extends CachedManager<Snowflake, ThreadChannel, ThreadChannelResolvable> {
|
|
|
|
protected constructor(channel: TextChannel | NewsChannel, iterable?: Iterable<RawThreadChannelData>);
|
2022-03-19 10:37:45 +00:00
|
|
|
public channel: TextChannel | NewsChannel;
|
|
|
|
public fetch(options: ThreadChannelResolvable, cacheOptions?: BaseFetchOptions): Promise<ThreadChannel | null>;
|
2023-01-18 07:24:06 +00:00
|
|
|
public fetch(options?: FetchChannelThreadsOptions, cacheOptions?: { cache?: boolean }): Promise<FetchedThreads>;
|
|
|
|
public fetchArchived(options?: FetchChannelThreadsOptions, cache?: boolean): Promise<FetchedThreads>;
|
|
|
|
public fetchActive(cache?: boolean, options?: FetchChannelThreadsOptions): Promise<FetchedThreads>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class ThreadMemberManager extends CachedManager<Snowflake, ThreadMember, ThreadMemberResolvable> {
|
|
|
|
private constructor(thread: ThreadChannel, iterable?: Iterable<RawThreadMemberData>);
|
|
|
|
public thread: ThreadChannel;
|
2023-01-10 11:08:05 +00:00
|
|
|
public readonly me: ThreadMember | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
public add(member: UserResolvable | '@me', reason?: string): Promise<Snowflake>;
|
2023-02-05 08:22:49 +00:00
|
|
|
public fetch(options?: FetchThreadMembersWithoutGuildMemberDataOptions): Promise<Collection<Snowflake, ThreadMember>>;
|
2023-02-05 08:14:42 +00:00
|
|
|
public fetch(member: ThreadMember<true>, options?: FetchMemberOptions): Promise<ThreadMember<true>>;
|
|
|
|
public fetch(
|
|
|
|
member: Snowflake,
|
|
|
|
options: FetchThreadMemberOptions & { withMember: true },
|
|
|
|
): Promise<ThreadMember<true>>;
|
|
|
|
public fetch(
|
|
|
|
options: FetchThreadMembersWithGuildMemberDataOptions,
|
|
|
|
): Promise<Collection<Snowflake, ThreadMember<true>>>;
|
|
|
|
public fetch(member: UserResolvable, options?: FetchThreadMemberOptions): Promise<ThreadMember>;
|
2022-03-19 10:37:45 +00:00
|
|
|
/** @deprecated Use `fetch(member, options)` instead. */
|
2023-02-05 08:14:42 +00:00
|
|
|
public fetch(cache: boolean, options?: FetchMembersOptions): Promise<Collection<Snowflake, ThreadMember>>;
|
2023-01-10 11:08:05 +00:00
|
|
|
public fetchMe(options?: BaseFetchOptions): Promise<ThreadMember>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public remove(id: Snowflake | '@me', reason?: string): Promise<Snowflake>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class UserManager extends CachedManager<Snowflake, User, UserResolvable> {
|
|
|
|
private constructor(client: Client, iterable?: Iterable<RawUserData>);
|
|
|
|
private dmChannel(userId: Snowflake): DMChannel | null;
|
|
|
|
public createDM(user: UserResolvable, options?: BaseFetchOptions): Promise<DMChannel>;
|
|
|
|
public deleteDM(user: UserResolvable): Promise<DMChannel>;
|
2022-11-25 12:45:42 +00:00
|
|
|
public fetch(user: UserResolvable, options?: BaseFetchOptions & { guildId?: Snowflake }): Promise<User>;
|
2022-03-19 10:37:45 +00:00
|
|
|
public fetchFlags(user: UserResolvable, options?: BaseFetchOptions): Promise<UserFlags>;
|
|
|
|
public send(user: UserResolvable, options: string | MessagePayload | MessageOptions): Promise<Message>;
|
|
|
|
}
|
|
|
|
|
2022-09-09 16:44:45 +00:00
|
|
|
export class RelationshipManager {
|
2022-06-04 06:26:53 +00:00
|
|
|
private constructor(client: Client, users?: object[]);
|
|
|
|
public cache: Collection<Snowflake, RelationshipTypes>;
|
2022-04-12 05:46:08 +00:00
|
|
|
public client: Client;
|
2022-09-09 16:44:45 +00:00
|
|
|
public readonly friendCache: Collection<Snowflake, User>;
|
|
|
|
public readonly blockedCache: Collection<Snowflake, User>;
|
|
|
|
public readonly incomingCache: Collection<Snowflake, User>;
|
|
|
|
public readonly outgoingCache: Collection<Snowflake, User>;
|
2022-07-19 13:27:32 +00:00
|
|
|
public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise<RelationshipTypes>;
|
|
|
|
public deleteFriend(user: UserResolvable): Promise<boolean>;
|
|
|
|
public deleteBlocked(user: UserResolvable): Promise<boolean>;
|
|
|
|
public sendFriendRequest(username: string, discriminator: number): Promise<boolean>;
|
|
|
|
public cancelFriendRequest(user: UserResolvable): Promise<boolean>;
|
|
|
|
public addFriend(user: UserResolvable): Promise<boolean>;
|
|
|
|
public addBlocked(user: UserResolvable): Promise<boolean>;
|
2022-09-16 12:21:17 +00:00
|
|
|
public setNickname(user: UserResolvable, nickname: string | null): Promise<boolean>;
|
2022-07-19 13:27:32 +00:00
|
|
|
private __cancel(id: Snowflake): Promise<boolean>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class VoiceStateManager extends CachedManager<Snowflake, VoiceState, typeof VoiceState> {
|
|
|
|
private constructor(guild: Guild, iterable?: Iterable<RawVoiceStateData>);
|
|
|
|
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<T> = abstract new (...args: any[]) => T;
|
|
|
|
export function PartialTextBasedChannel<T>(Base?: Constructable<T>): Constructable<T & PartialTextBasedChannelFields>;
|
|
|
|
export function TextBasedChannelMixin<T, I extends keyof TextBasedChannelFields = never>(
|
|
|
|
Base?: Constructable<T>,
|
|
|
|
ignore?: I[],
|
|
|
|
): Constructable<T & Omit<TextBasedChannelFields, I>>;
|
|
|
|
|
|
|
|
export interface PartialTextBasedChannelFields {
|
|
|
|
send(options: string | MessagePayload | MessageOptions): Promise<Message>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TextBasedChannelFields extends PartialTextBasedChannelFields {
|
|
|
|
lastMessageId: Snowflake | null;
|
|
|
|
readonly lastMessage: Message | null;
|
|
|
|
lastPinTimestamp: number | null;
|
|
|
|
readonly lastPinAt: Date | null;
|
2022-06-06 04:21:36 +00:00
|
|
|
messages: MessageManager;
|
2022-10-09 12:37:04 +00:00
|
|
|
interactions: InteractionManager;
|
2022-03-19 10:37:45 +00:00
|
|
|
awaitMessageComponent<T extends MessageComponentTypeResolvable = 'ACTION_ROW'>(
|
|
|
|
options?: AwaitMessageCollectorOptionsParams<T, true>,
|
|
|
|
): Promise<MappedInteractionTypes[T]>;
|
|
|
|
awaitMessages(options?: AwaitMessagesOptions): Promise<Collection<Snowflake, Message>>;
|
|
|
|
bulkDelete(
|
|
|
|
messages: Collection<Snowflake, Message> | readonly MessageResolvable[] | number,
|
|
|
|
filterOld?: boolean,
|
2022-08-11 02:54:55 +00:00
|
|
|
): Promise<Collection<Snowflake, Message | PartialMessage | undefined>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
createMessageComponentCollector<T extends MessageComponentTypeResolvable = 'ACTION_ROW'>(
|
|
|
|
options?: MessageChannelCollectorOptionsParams<T, true>,
|
|
|
|
): InteractionCollector<MappedInteractionTypes[T]>;
|
|
|
|
createMessageCollector(options?: MessageCollectorOptions): MessageCollector;
|
2022-06-06 04:21:36 +00:00
|
|
|
createWebhook(name: string, options?: ChannelWebhookCreateOptions): Promise<Webhook>;
|
|
|
|
setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<this>;
|
|
|
|
setNSFW(nsfw?: boolean, reason?: string): Promise<this>;
|
|
|
|
fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
sendTyping(): Promise<void>;
|
2022-10-09 12:37:04 +00:00
|
|
|
sendSlash(bot: UserResolvable, commandName: string, ...args: any): Promise<InteractionResponse>;
|
2023-04-19 10:25:53 +00:00
|
|
|
searchInteraction(applicationId: Snowflake, type?: ApplicationCommandTypes): Promise<object>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function PartialWebhookMixin<T>(Base?: Constructable<T>): Constructable<T & PartialWebhookFields>;
|
|
|
|
export function WebhookMixin<T>(Base?: Constructable<T>): Constructable<T & WebhookFields>;
|
|
|
|
|
|
|
|
export interface PartialWebhookFields {
|
|
|
|
id: Snowflake;
|
|
|
|
readonly url: string;
|
|
|
|
deleteMessage(message: MessageResolvable | APIMessage | '@original', threadId?: Snowflake): Promise<void>;
|
|
|
|
editMessage(
|
|
|
|
message: MessageResolvable | '@original',
|
|
|
|
options: string | MessagePayload | WebhookEditMessageOptions,
|
|
|
|
): Promise<Message | APIMessage>;
|
|
|
|
fetchMessage(message: Snowflake | '@original', options?: WebhookFetchMessageOptions): Promise<Message | APIMessage>;
|
|
|
|
/* tslint:disable:unified-signatures */
|
|
|
|
/** @deprecated */
|
|
|
|
fetchMessage(message: Snowflake | '@original', cache?: boolean): Promise<Message | APIMessage>;
|
|
|
|
/* tslint:enable:unified-signatures */
|
2022-05-14 08:06:15 +00:00
|
|
|
send(options: string | MessagePayload | Omit<WebhookMessageOptions, 'flags'>): Promise<Message | APIMessage>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface WebhookFields extends PartialWebhookFields {
|
|
|
|
readonly createdAt: Date;
|
|
|
|
readonly createdTimestamp: number;
|
|
|
|
delete(reason?: string): Promise<void>;
|
|
|
|
edit(options: WebhookEditData, reason?: string): Promise<Webhook>;
|
|
|
|
sendSlackMessage(body: unknown): Promise<boolean>;
|
|
|
|
}
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region Typedefs
|
2022-07-09 10:07:01 +00:00
|
|
|
export type PurchasedFlagsString = 'NITRO_CLASSIC' | 'NITRO' | 'GUILD_BOOST';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
2023-03-02 11:26:25 +00:00
|
|
|
export type PremiumUsageFlagsString = 'PREMIUM_DISCRIMINATOR' | 'ANIMATED_AVATAR' | 'PROFILE_BANNER';
|
2022-12-22 12:37:05 +00:00
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export type ActivityFlagsString =
|
|
|
|
| 'INSTANCE'
|
|
|
|
| 'JOIN'
|
|
|
|
| 'SPECTATE'
|
|
|
|
| 'JOIN_REQUEST'
|
|
|
|
| 'SYNC'
|
|
|
|
| 'PLAY'
|
|
|
|
| 'PARTY_PRIVACY_FRIENDS'
|
|
|
|
| 'PARTY_PRIVACY_VOICE_CHANNEL'
|
|
|
|
| 'EMBEDDED';
|
|
|
|
|
2022-11-15 13:06:03 +00:00
|
|
|
export type ActivitiesOptions = Omit<ActivityOptions | CustomStatus | RichPresence | SpotifyRPC, 'shardId'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface ActivityOptions {
|
|
|
|
name?: string;
|
|
|
|
url?: string;
|
|
|
|
type?: ExcludeEnum<typeof ActivityTypes, 'CUSTOM'>;
|
|
|
|
shardId?: number | readonly number[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ActivityPlatform = 'desktop' | 'samsung' | 'xbox';
|
|
|
|
|
|
|
|
export type ActivityType = keyof typeof ActivityTypes;
|
|
|
|
|
|
|
|
export interface AddGuildMemberOptions {
|
|
|
|
accessToken: string;
|
|
|
|
nick?: string;
|
|
|
|
roles?: Collection<Snowflake, Role> | RoleResolvable[];
|
|
|
|
mute?: boolean;
|
|
|
|
deaf?: boolean;
|
|
|
|
force?: boolean;
|
|
|
|
fetchWhenExisting?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'jpeg';
|
|
|
|
|
|
|
|
export type AllowedImageSize = 16 | 32 | 56 | 64 | 96 | 128 | 256 | 300 | 512 | 600 | 1024 | 2048 | 4096;
|
|
|
|
|
|
|
|
export type AllowedPartial = User | Channel | GuildMember | Message | MessageReaction;
|
|
|
|
|
|
|
|
export type AllowedThreadTypeForNewsChannel = 'GUILD_NEWS_THREAD' | 10;
|
|
|
|
|
|
|
|
export type AllowedThreadTypeForTextChannel = 'GUILD_PUBLIC_THREAD' | 'GUILD_PRIVATE_THREAD' | 11 | 12;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface ClientApplicationInstallParams {
|
|
|
|
scopes: InviteScope[];
|
|
|
|
permissions: Readonly<Permissions>;
|
|
|
|
}
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface APIErrors {
|
|
|
|
UNKNOWN_ACCOUNT: 10001;
|
|
|
|
UNKNOWN_APPLICATION: 10002;
|
|
|
|
UNKNOWN_CHANNEL: 10003;
|
|
|
|
UNKNOWN_GUILD: 10004;
|
|
|
|
UNKNOWN_INTEGRATION: 10005;
|
|
|
|
UNKNOWN_INVITE: 10006;
|
|
|
|
UNKNOWN_MEMBER: 10007;
|
|
|
|
UNKNOWN_MESSAGE: 10008;
|
|
|
|
UNKNOWN_OVERWRITE: 10009;
|
|
|
|
UNKNOWN_PROVIDER: 10010;
|
|
|
|
UNKNOWN_ROLE: 10011;
|
|
|
|
UNKNOWN_TOKEN: 10012;
|
|
|
|
UNKNOWN_USER: 10013;
|
|
|
|
UNKNOWN_EMOJI: 10014;
|
|
|
|
UNKNOWN_WEBHOOK: 10015;
|
|
|
|
UNKNOWN_WEBHOOK_SERVICE: 10016;
|
|
|
|
UNKNOWN_SESSION: 10020;
|
|
|
|
UNKNOWN_BAN: 10026;
|
|
|
|
UNKNOWN_SKU: 10027;
|
|
|
|
UNKNOWN_STORE_LISTING: 10028;
|
|
|
|
UNKNOWN_ENTITLEMENT: 10029;
|
|
|
|
UNKNOWN_BUILD: 10030;
|
|
|
|
UNKNOWN_LOBBY: 10031;
|
|
|
|
UNKNOWN_BRANCH: 10032;
|
|
|
|
UNKNOWN_STORE_DIRECTORY_LAYOUT: 10033;
|
|
|
|
UNKNOWN_REDISTRIBUTABLE: 10036;
|
|
|
|
UNKNOWN_GIFT_CODE: 10038;
|
|
|
|
UNKNOWN_STREAM: 10049;
|
|
|
|
UNKNOWN_PREMIUM_SERVER_SUBSCRIBE_COOLDOWN: 10050;
|
|
|
|
UNKNOWN_GUILD_TEMPLATE: 10057;
|
|
|
|
UNKNOWN_DISCOVERABLE_SERVER_CATEGORY: 10059;
|
|
|
|
UNKNOWN_STICKER: 10060;
|
|
|
|
UNKNOWN_INTERACTION: 10062;
|
|
|
|
UNKNOWN_APPLICATION_COMMAND: 10063;
|
|
|
|
UNKNOWN_APPLICATION_COMMAND_PERMISSIONS: 10066;
|
|
|
|
UNKNOWN_STAGE_INSTANCE: 10067;
|
|
|
|
UNKNOWN_GUILD_MEMBER_VERIFICATION_FORM: 10068;
|
|
|
|
UNKNOWN_GUILD_WELCOME_SCREEN: 10069;
|
|
|
|
UNKNOWN_GUILD_SCHEDULED_EVENT: 10070;
|
|
|
|
UNKNOWN_GUILD_SCHEDULED_EVENT_USER: 10071;
|
|
|
|
BOT_PROHIBITED_ENDPOINT: 20001;
|
|
|
|
BOT_ONLY_ENDPOINT: 20002;
|
|
|
|
CANNOT_SEND_EXPLICIT_CONTENT: 20009;
|
|
|
|
NOT_AUTHORIZED: 20012;
|
|
|
|
SLOWMODE_RATE_LIMIT: 20016;
|
|
|
|
ACCOUNT_OWNER_ONLY: 20018;
|
|
|
|
ANNOUNCEMENT_EDIT_LIMIT_EXCEEDED: 20022;
|
|
|
|
CHANNEL_HIT_WRITE_RATELIMIT: 20028;
|
|
|
|
SERVER_HIT_WRITE_RATELIMIT: 20029;
|
|
|
|
CONTENT_NOT_ALLOWED: 20031;
|
|
|
|
GUILD_PREMIUM_LEVEL_TOO_LOW: 20035;
|
|
|
|
MAXIMUM_GUILDS: 30001;
|
|
|
|
MAXIMUM_FRIENDS: 30002;
|
|
|
|
MAXIMUM_PINS: 30003;
|
|
|
|
MAXIMUM_RECIPIENTS: 30004;
|
|
|
|
MAXIMUM_ROLES: 30005;
|
2022-07-10 09:26:40 +00:00
|
|
|
MAXIMUM_USERNAMES: 30006;
|
2022-03-19 10:37:45 +00:00
|
|
|
MAXIMUM_WEBHOOKS: 30007;
|
|
|
|
MAXIMUM_EMOJIS: 30008;
|
|
|
|
MAXIMUM_REACTIONS: 30010;
|
|
|
|
MAXIMUM_CHANNELS: 30013;
|
|
|
|
MAXIMUM_ATTACHMENTS: 30015;
|
|
|
|
MAXIMUM_INVITES: 30016;
|
|
|
|
MAXIMUM_ANIMATED_EMOJIS: 30018;
|
|
|
|
MAXIMUM_SERVER_MEMBERS: 30019;
|
|
|
|
MAXIMUM_NUMBER_OF_SERVER_CATEGORIES: 30030;
|
|
|
|
GUILD_ALREADY_HAS_TEMPLATE: 30031;
|
2022-07-01 03:32:37 +00:00
|
|
|
MAXIMUM_THREAD_PARTICIPANTS: 30033;
|
2022-03-19 10:37:45 +00:00
|
|
|
MAXIMUM_NON_GUILD_MEMBERS_BANS: 30035;
|
|
|
|
MAXIMUM_BAN_FETCHES: 30037;
|
|
|
|
MAXIMUM_NUMBER_OF_UNCOMPLETED_GUILD_SCHEDULED_EVENTS_REACHED: 30038;
|
|
|
|
MAXIMUM_NUMBER_OF_STICKERS_REACHED: 30039;
|
|
|
|
MAXIMUM_PRUNE_REQUESTS: 30040;
|
|
|
|
MAXIMUM_GUILD_WIDGET_SETTINGS_UPDATE: 30042;
|
2023-01-26 06:48:53 +00:00
|
|
|
MAXIMUM_NUMBER_OF_PREMIUM_EMOJIS: 30056;
|
2022-03-19 10:37:45 +00:00
|
|
|
UNAUTHORIZED: 40001;
|
|
|
|
ACCOUNT_VERIFICATION_REQUIRED: 40002;
|
|
|
|
DIRECT_MESSAGES_TOO_FAST: 40003;
|
|
|
|
REQUEST_ENTITY_TOO_LARGE: 40005;
|
|
|
|
FEATURE_TEMPORARILY_DISABLED: 40006;
|
|
|
|
USER_BANNED: 40007;
|
|
|
|
TARGET_USER_NOT_CONNECTED_TO_VOICE: 40032;
|
|
|
|
ALREADY_CROSSPOSTED: 40033;
|
|
|
|
MISSING_ACCESS: 50001;
|
|
|
|
INVALID_ACCOUNT_TYPE: 50002;
|
|
|
|
CANNOT_EXECUTE_ON_DM: 50003;
|
|
|
|
EMBED_DISABLED: 50004;
|
|
|
|
CANNOT_EDIT_MESSAGE_BY_OTHER: 50005;
|
|
|
|
CANNOT_SEND_EMPTY_MESSAGE: 50006;
|
|
|
|
CANNOT_MESSAGE_USER: 50007;
|
|
|
|
CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL: 50008;
|
|
|
|
CHANNEL_VERIFICATION_LEVEL_TOO_HIGH: 50009;
|
|
|
|
OAUTH2_APPLICATION_BOT_ABSENT: 50010;
|
|
|
|
MAXIMUM_OAUTH2_APPLICATIONS: 50011;
|
|
|
|
INVALID_OAUTH_STATE: 50012;
|
|
|
|
MISSING_PERMISSIONS: 50013;
|
|
|
|
INVALID_AUTHENTICATION_TOKEN: 50014;
|
|
|
|
NOTE_TOO_LONG: 50015;
|
|
|
|
INVALID_BULK_DELETE_QUANTITY: 50016;
|
2022-06-08 03:56:09 +00:00
|
|
|
INVALID_MFA_LEVEL: 50017;
|
2022-03-19 10:37:45 +00:00
|
|
|
CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL: 50019;
|
|
|
|
INVALID_OR_TAKEN_INVITE_CODE: 50020;
|
|
|
|
CANNOT_EXECUTE_ON_SYSTEM_MESSAGE: 50021;
|
|
|
|
CANNOT_EXECUTE_ON_CHANNEL_TYPE: 50024;
|
|
|
|
INVALID_OAUTH_TOKEN: 50025;
|
|
|
|
MISSING_OAUTH_SCOPE: 50026;
|
|
|
|
INVALID_WEBHOOK_TOKEN: 50027;
|
|
|
|
INVALID_ROLE: 50028;
|
|
|
|
INVALID_RECIPIENTS: 50033;
|
|
|
|
BULK_DELETE_MESSAGE_TOO_OLD: 50034;
|
|
|
|
INVALID_FORM_BODY: 50035;
|
|
|
|
INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT: 50036;
|
|
|
|
INVALID_API_VERSION: 50041;
|
|
|
|
FILE_UPLOADED_EXCEEDS_MAXIMUM_SIZE: 50045;
|
|
|
|
INVALID_FILE_UPLOADED: 50046;
|
2022-07-09 12:47:00 +00:00
|
|
|
GIFT_CODE_CLAIMED: 50050;
|
2022-03-19 10:37:45 +00:00
|
|
|
CANNOT_SELF_REDEEM_GIFT: 50054;
|
|
|
|
INVALID_GUILD: 50055;
|
2022-07-17 17:56:30 +00:00
|
|
|
INVALID_MESSAGE_TYPE: 50068;
|
2022-03-19 10:37:45 +00:00
|
|
|
PAYMENT_SOURCE_REQUIRED: 50070;
|
|
|
|
CANNOT_DELETE_COMMUNITY_REQUIRED_CHANNEL: 50074;
|
|
|
|
INVALID_STICKER_SENT: 50081;
|
2022-07-01 03:32:37 +00:00
|
|
|
INVALID_OPERATION_ON_ARCHIVED_THREAD: 50083;
|
2022-03-19 10:37:45 +00:00
|
|
|
INVALID_THREAD_NOTIFICATION_SETTINGS: 50084;
|
|
|
|
PARAMETER_EARLIER_THAN_CREATION: 50085;
|
|
|
|
GUILD_NOT_AVAILABLE_IN_LOCATION: 50095;
|
|
|
|
GUILD_MONETIZATION_REQUIRED: 50097;
|
|
|
|
INSUFFICIENT_BOOSTS: 50101;
|
|
|
|
INVALID_JSON: 50109;
|
2023-01-26 06:48:53 +00:00
|
|
|
CANNOT_MIX_SUBSCRIPTION_AND_NON_SUBSCRIPTION_ROLES_FOR_EMOJI: 50144;
|
2023-04-25 11:18:55 +00:00
|
|
|
VOICE_MESSAGES_DO_NOT_SUPPORT_ADDITIONAL_CONTENT: 50159;
|
|
|
|
VOICE_MESSAGES_MUST_HAVE_A_SINGLE_AUDIO_ATTACHMENT: 50160;
|
|
|
|
VOICE_MESSAGES_MUST_HAVE_SUPPORTING_METADATA: 50161;
|
|
|
|
VOICE_MESSAGES_CANNOT_BE_EDITED: 50162;
|
|
|
|
YOU_CANNOT_SEND_VOICE_MESSAGES_IN_THIS_CHANNEL: 50173;
|
2023-01-26 06:48:53 +00:00
|
|
|
CANNOT_CONVERT_PREMIUM_EMOJI_TO_NORMAL_EMOJI: 50145;
|
2022-03-19 10:37:45 +00:00
|
|
|
TWO_FACTOR_REQUIRED: 60003;
|
2022-07-10 09:26:40 +00:00
|
|
|
INVALID_TWO_FACTOR_CODE: 60008;
|
2022-03-19 10:37:45 +00:00
|
|
|
NO_USERS_WITH_DISCORDTAG_EXIST: 80004;
|
|
|
|
REACTION_BLOCKED: 90001;
|
|
|
|
RESOURCE_OVERLOADED: 130000;
|
|
|
|
STAGE_ALREADY_OPEN: 150006;
|
|
|
|
CANNOT_REPLY_WITHOUT_READ_MESSAGE_HISTORY_PERMISSION: 160002;
|
|
|
|
MESSAGE_ALREADY_HAS_THREAD: 160004;
|
|
|
|
THREAD_LOCKED: 160005;
|
|
|
|
MAXIMUM_ACTIVE_THREADS: 160006;
|
|
|
|
MAXIMUM_ACTIVE_ANNOUNCEMENT_THREADS: 160007;
|
|
|
|
INVALID_JSON_FOR_UPLOADED_LOTTIE_FILE: 170001;
|
|
|
|
UPLOADED_LOTTIES_CANNOT_CONTAIN_RASTERIZED_IMAGES: 170002;
|
|
|
|
STICKER_MAXIMUM_FRAMERATE_EXCEEDED: 170003;
|
|
|
|
STICKER_FRAME_COUNT_EXCEEDS_MAXIMUM_OF_1000_FRAMES: 170004;
|
|
|
|
LOTTIE_ANIMATION_MAXIMUM_DIMENSIONS_EXCEEDED: 170005;
|
|
|
|
STICKER_FRAME_RATE_IS_TOO_SMALL_OR_TOO_LARGE: 170006;
|
|
|
|
STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS: 170007;
|
|
|
|
CANNOT_UPDATE_A_FINISHED_EVENT: 180000;
|
|
|
|
FAILED_TO_CREATE_STAGE_NEEDED_FOR_STAGE_EVENT: 180002;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface APIRequest {
|
|
|
|
method: 'get' | 'post' | 'delete' | 'patch' | 'put';
|
|
|
|
options: unknown;
|
|
|
|
path: string;
|
|
|
|
retries: number;
|
|
|
|
route: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationAsset {
|
|
|
|
name: string;
|
|
|
|
id: Snowflake;
|
|
|
|
type: 'BIG' | 'SMALL';
|
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface ClientEvents extends BaseClientEvents {
|
|
|
|
/** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */
|
|
|
|
applicationCommandCreate: [command: ApplicationCommand];
|
|
|
|
/** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */
|
|
|
|
applicationCommandDelete: [command: ApplicationCommand];
|
|
|
|
/** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */
|
|
|
|
applicationCommandUpdate: [oldCommand: ApplicationCommand | null, newCommand: ApplicationCommand];
|
2023-02-19 05:01:37 +00:00
|
|
|
applicationCommandPermissionsUpdate: [data: ApplicationCommandPermissionsUpdateData];
|
2022-12-20 15:46:50 +00:00
|
|
|
autoModerationActionExecution: [autoModerationActionExecution: AutoModerationActionExecution];
|
|
|
|
autoModerationRuleCreate: [autoModerationRule: AutoModerationRule];
|
|
|
|
autoModerationRuleDelete: [autoModerationRule: AutoModerationRule];
|
|
|
|
autoModerationRuleUpdate: [
|
|
|
|
oldAutoModerationRule: AutoModerationRule | null,
|
|
|
|
newAutoModerationRule: AutoModerationRule,
|
|
|
|
];
|
2022-05-14 08:06:15 +00:00
|
|
|
cacheSweep: [message: string];
|
|
|
|
channelCreate: [channel: NonThreadGuildBasedChannel];
|
|
|
|
channelDelete: [channel: DMChannel | NonThreadGuildBasedChannel];
|
|
|
|
channelPinsUpdate: [channel: TextBasedChannel, date: Date];
|
2022-09-16 12:08:15 +00:00
|
|
|
channelRecipientAdd: [channel: PartialGroupDMChannel, user: User];
|
|
|
|
channelRecipientRemove: [channel: PartialGroupDMChannel, user: User];
|
2022-05-14 08:06:15 +00:00
|
|
|
channelUpdate: [
|
|
|
|
oldChannel: DMChannel | NonThreadGuildBasedChannel,
|
|
|
|
newChannel: DMChannel | NonThreadGuildBasedChannel,
|
|
|
|
];
|
|
|
|
warn: [message: string];
|
|
|
|
emojiCreate: [emoji: GuildEmoji];
|
|
|
|
emojiDelete: [emoji: GuildEmoji];
|
|
|
|
emojiUpdate: [oldEmoji: GuildEmoji, newEmoji: GuildEmoji];
|
|
|
|
error: [error: Error];
|
2023-03-05 10:05:40 +00:00
|
|
|
callCreate: [call: Call];
|
|
|
|
callDelete: [call: Call];
|
|
|
|
callUpdate: [call: Call];
|
2022-05-14 08:06:15 +00:00
|
|
|
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<Snowflake, GuildMember>,
|
|
|
|
guild: Guild,
|
2023-01-10 10:58:58 +00:00
|
|
|
data: { count: number; index: number; nonce: string | undefined; notFound: unknown[] },
|
2022-05-14 08:06:15 +00:00
|
|
|
];
|
|
|
|
guildMemberUpdate: [oldMember: GuildMember | PartialGuildMember, newMember: GuildMember];
|
|
|
|
guildMemberListUpdate: [
|
|
|
|
members: Collection<Snowflake, GuildMember>,
|
|
|
|
guild: Guild,
|
|
|
|
data: {}, // see: https://luna.gitlab.io/discord-unofficial-docs/lazy_guilds.html
|
|
|
|
];
|
|
|
|
guildUpdate: [oldGuild: Guild, newGuild: Guild];
|
|
|
|
inviteCreate: [invite: Invite];
|
|
|
|
inviteDelete: [invite: Invite];
|
|
|
|
/** @deprecated Use messageCreate instead */
|
|
|
|
message: [message: Message];
|
2022-08-03 12:50:41 +00:00
|
|
|
messageAck: [channel: TextChannel, message_id: Snowflake, isRead: boolean, raw: object];
|
2022-05-14 08:06:15 +00:00
|
|
|
messageCreate: [message: Message];
|
|
|
|
messageDelete: [message: Message | PartialMessage];
|
|
|
|
messageReactionRemoveAll: [
|
|
|
|
message: Message | PartialMessage,
|
|
|
|
reactions: Collection<string | Snowflake, MessageReaction>,
|
|
|
|
];
|
|
|
|
messageReactionRemoveEmoji: [reaction: MessageReaction | PartialMessageReaction];
|
|
|
|
messageDeleteBulk: [messages: Collection<Snowflake, Message | PartialMessage>];
|
|
|
|
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<true>];
|
|
|
|
invalidated: [];
|
|
|
|
roleCreate: [role: Role];
|
|
|
|
roleDelete: [role: Role];
|
|
|
|
roleUpdate: [oldRole: Role, newRole: Role];
|
2022-06-04 06:26:53 +00:00
|
|
|
threadCreate: [thread: ThreadChannel, newlyCreated: boolean];
|
2022-05-14 08:06:15 +00:00
|
|
|
threadDelete: [thread: ThreadChannel];
|
|
|
|
threadListSync: [threads: Collection<Snowflake, ThreadChannel>];
|
|
|
|
threadMemberUpdate: [oldMember: ThreadMember, newMember: ThreadMember];
|
|
|
|
threadMembersUpdate: [
|
|
|
|
oldMembers: Collection<Snowflake, ThreadMember>,
|
|
|
|
newMembers: Collection<Snowflake, ThreadMember>,
|
|
|
|
];
|
|
|
|
threadUpdate: [oldThread: ThreadChannel, newThread: ThreadChannel];
|
|
|
|
typingStart: [typing: Typing];
|
|
|
|
userUpdate: [oldUser: User | PartialUser, newUser: User];
|
|
|
|
userSettingsUpdate: [setting: RawUserSettingsData];
|
2023-01-08 07:06:42 +00:00
|
|
|
userGuildSettingsUpdate: [guild: Guild];
|
2022-05-14 08:06:15 +00:00
|
|
|
voiceStateUpdate: [oldState: VoiceState, newState: VoiceState];
|
2023-04-15 12:53:43 +00:00
|
|
|
webhookUpdate: [channel: TextChannel | NewsChannel | VoiceChannel | ForumChannel | StageChannel];
|
2022-05-14 08:06:15 +00:00
|
|
|
/** @deprecated Use interactionCreate instead */
|
|
|
|
interaction: [interaction: Interaction];
|
|
|
|
interactionCreate: [interaction: Interaction | { nonce: Snowflake; id: Snowflake }];
|
|
|
|
interactionSuccess: [interaction: { nonce: Snowflake; id: Snowflake }];
|
2022-06-14 01:48:06 +00:00
|
|
|
interactionFailure: [interaction: { nonce: Snowflake; id: Snowflake }];
|
2022-06-13 16:53:43 +00:00
|
|
|
interactionModalCreate: [modal: Modal];
|
2022-05-14 08:06:15 +00:00
|
|
|
shardDisconnect: [closeEvent: CloseEvent, shardId: number];
|
|
|
|
shardError: [error: Error, shardId: number];
|
|
|
|
shardReady: [shardId: number, unavailableGuilds: Set<Snowflake> | 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, newGuildScheduledEvent: GuildScheduledEvent];
|
|
|
|
guildScheduledEventDelete: [guildScheduledEvent: GuildScheduledEvent];
|
|
|
|
guildScheduledEventUserAdd: [guildScheduledEvent: GuildScheduledEvent, user: User];
|
|
|
|
guildScheduledEventUserRemove: [guildScheduledEvent: GuildScheduledEvent, user: User];
|
2023-02-12 08:52:03 +00:00
|
|
|
guildAuditLogEntryCreate: [auditLogEntry: GuildAuditLogsEntry, guild: Guild];
|
2022-05-14 08:06:15 +00:00
|
|
|
relationshipAdd: [id: Snowflake, type: RelationshipTypes];
|
|
|
|
relationshipRemove: [id: Snowflake];
|
2022-09-16 12:08:15 +00:00
|
|
|
relationshipUpdate: [id: Snowflake, type: RelationshipTypes, data: object];
|
2022-05-14 08:06:15 +00:00
|
|
|
unhandledPacket: [packet: { op: GatewayOpcodes | number; d?: any; s?: number; t?: string }, shard: WebSocketShard];
|
2022-06-25 03:28:31 +00:00
|
|
|
update: [oldVersion: string, newVersion: string];
|
2023-03-07 16:17:22 +00:00
|
|
|
captchaRequired: [request: Request, captcha: Captcha];
|
2022-05-14 08:06:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ConstantsEvents {
|
|
|
|
RATE_LIMIT: 'rateLimit';
|
|
|
|
INVALID_REQUEST_WARNING: 'invalidRequestWarning';
|
|
|
|
API_RESPONSE: 'apiResponse';
|
|
|
|
API_REQUEST: 'apiRequest';
|
|
|
|
CLIENT_READY: 'ready';
|
2022-07-12 12:30:18 +00:00
|
|
|
APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE: 'applicationCommandAutocompleteResponse';
|
2022-05-14 08:06:15 +00:00
|
|
|
/** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */
|
|
|
|
APPLICATION_COMMAND_CREATE: 'applicationCommandCreate';
|
|
|
|
/** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */
|
|
|
|
APPLICATION_COMMAND_DELETE: 'applicationCommandDelete';
|
|
|
|
/** @deprecated See [this issue](https://github.com/discord/discord-api-docs/issues/3690) for more information. */
|
|
|
|
APPLICATION_COMMAND_UPDATE: 'applicationCommandUpdate';
|
2023-02-19 05:01:37 +00:00
|
|
|
APPLICATION_COMMAND_PERMISSIONS_UPDATE: 'applicationCommandPermissionsUpdate';
|
2022-07-15 10:26:25 +00:00
|
|
|
CALL_CREATE: 'callCreate';
|
|
|
|
CALL_DELETE: 'callDelete';
|
|
|
|
CALL_UPDATE: 'callUpdate';
|
2022-05-14 08:06:15 +00:00
|
|
|
GUILD_CREATE: 'guildCreate';
|
|
|
|
GUILD_DELETE: 'guildDelete';
|
|
|
|
GUILD_UPDATE: 'guildUpdate';
|
|
|
|
GUILD_UNAVAILABLE: 'guildUnavailable';
|
|
|
|
GUILD_MEMBER_ADD: 'guildMemberAdd';
|
|
|
|
GUILD_MEMBER_REMOVE: 'guildMemberRemove';
|
|
|
|
GUILD_MEMBER_UPDATE: 'guildMemberUpdate';
|
|
|
|
GUILD_MEMBER_AVAILABLE: 'guildMemberAvailable';
|
|
|
|
GUILD_MEMBERS_CHUNK: 'guildMembersChunk';
|
|
|
|
GUILD_MEMBER_LIST_UPDATE: 'guildMemberListUpdate';
|
|
|
|
GUILD_INTEGRATIONS_UPDATE: 'guildIntegrationsUpdate';
|
|
|
|
GUILD_ROLE_CREATE: 'roleCreate';
|
|
|
|
GUILD_ROLE_DELETE: 'roleDelete';
|
|
|
|
INVITE_CREATE: 'inviteCreate';
|
|
|
|
INVITE_DELETE: 'inviteDelete';
|
|
|
|
GUILD_ROLE_UPDATE: 'roleUpdate';
|
|
|
|
GUILD_EMOJI_CREATE: 'emojiCreate';
|
|
|
|
GUILD_EMOJI_DELETE: 'emojiDelete';
|
|
|
|
GUILD_EMOJI_UPDATE: 'emojiUpdate';
|
|
|
|
GUILD_BAN_ADD: 'guildBanAdd';
|
|
|
|
GUILD_BAN_REMOVE: 'guildBanRemove';
|
|
|
|
CHANNEL_CREATE: 'channelCreate';
|
|
|
|
CHANNEL_DELETE: 'channelDelete';
|
|
|
|
CHANNEL_UPDATE: 'channelUpdate';
|
|
|
|
CHANNEL_PINS_UPDATE: 'channelPinsUpdate';
|
2022-09-16 12:08:15 +00:00
|
|
|
CHANNEL_RECIPIENT_ADD: 'channelRecipientAdd';
|
|
|
|
CHANNEL_RECIPIENT_REMOVE: 'channelRecipientRemove';
|
2022-08-03 12:34:58 +00:00
|
|
|
MESSAGE_ACK: 'messageAck';
|
2022-05-14 08:06:15 +00:00
|
|
|
MESSAGE_CREATE: 'messageCreate';
|
|
|
|
MESSAGE_DELETE: 'messageDelete';
|
|
|
|
MESSAGE_UPDATE: 'messageUpdate';
|
|
|
|
MESSAGE_BULK_DELETE: 'messageDeleteBulk';
|
|
|
|
MESSAGE_REACTION_ADD: 'messageReactionAdd';
|
|
|
|
MESSAGE_REACTION_REMOVE: 'messageReactionRemove';
|
|
|
|
MESSAGE_REACTION_REMOVE_ALL: 'messageReactionRemoveAll';
|
|
|
|
MESSAGE_REACTION_REMOVE_EMOJI: 'messageReactionRemoveEmoji';
|
|
|
|
THREAD_CREATE: 'threadCreate';
|
|
|
|
THREAD_DELETE: 'threadDelete';
|
|
|
|
THREAD_UPDATE: 'threadUpdate';
|
|
|
|
THREAD_LIST_SYNC: 'threadListSync';
|
|
|
|
THREAD_MEMBER_UPDATE: 'threadMemberUpdate';
|
|
|
|
THREAD_MEMBERS_UPDATE: 'threadMembersUpdate';
|
|
|
|
USER_UPDATE: 'userUpdate';
|
|
|
|
USER_SETTINGS_UPDATE: 'userSettingsUpdate';
|
2023-01-08 07:06:42 +00:00
|
|
|
USER_GUILD_SETTINGS_UPDATE: 'userGuildSettingsUpdate';
|
2022-05-14 08:06:15 +00:00
|
|
|
PRESENCE_UPDATE: 'presenceUpdate';
|
|
|
|
VOICE_SERVER_UPDATE: 'voiceServerUpdate';
|
|
|
|
VOICE_STATE_UPDATE: 'voiceStateUpdate';
|
|
|
|
TYPING_START: 'typingStart';
|
|
|
|
WEBHOOKS_UPDATE: 'webhookUpdate';
|
|
|
|
INTERACTION_CREATE: 'interactionCreate';
|
|
|
|
INTERACTION_SUCCESS: 'interactionSuccess';
|
2022-06-13 16:53:43 +00:00
|
|
|
INTERACTION_MODAL_CREATE: 'interactionModalCreate';
|
2022-06-14 01:48:06 +00:00
|
|
|
INTERACTION_FAILURE: 'interactionFailure';
|
2022-05-14 08:06:15 +00:00
|
|
|
ERROR: 'error';
|
|
|
|
WARN: 'warn';
|
|
|
|
DEBUG: 'debug';
|
|
|
|
CACHE_SWEEP: 'cacheSweep';
|
|
|
|
SHARD_DISCONNECT: 'shardDisconnect';
|
|
|
|
SHARD_ERROR: 'shardError';
|
|
|
|
SHARD_RECONNECTING: 'shardReconnecting';
|
|
|
|
SHARD_READY: 'shardReady';
|
|
|
|
SHARD_RESUME: 'shardResume';
|
|
|
|
INVALIDATED: 'invalidated';
|
|
|
|
RAW: 'raw';
|
|
|
|
STAGE_INSTANCE_CREATE: 'stageInstanceCreate';
|
|
|
|
STAGE_INSTANCE_UPDATE: 'stageInstanceUpdate';
|
|
|
|
STAGE_INSTANCE_DELETE: 'stageInstanceDelete';
|
|
|
|
GUILD_STICKER_CREATE: 'stickerCreate';
|
|
|
|
GUILD_STICKER_DELETE: 'stickerDelete';
|
|
|
|
GUILD_STICKER_UPDATE: 'stickerUpdate';
|
|
|
|
GUILD_SCHEDULED_EVENT_CREATE: 'guildScheduledEventCreate';
|
|
|
|
GUILD_SCHEDULED_EVENT_UPDATE: 'guildScheduledEventUpdate';
|
|
|
|
GUILD_SCHEDULED_EVENT_DELETE: 'guildScheduledEventDelete';
|
|
|
|
GUILD_SCHEDULED_EVENT_USER_ADD: 'guildScheduledEventUserAdd';
|
|
|
|
GUILD_SCHEDULED_EVENT_USER_REMOVE: 'guildScheduledEventUserRemove';
|
2023-02-12 08:52:03 +00:00
|
|
|
GUILD_AUDIT_LOG_ENTRY_CREATE: 'guildAuditLogEntryCreate';
|
2022-05-14 08:06:15 +00:00
|
|
|
RELATIONSHIP_ADD: 'relationshipAdd';
|
|
|
|
RELATIONSHIP_REMOVE: 'relationshipRemove';
|
2022-09-16 12:08:15 +00:00
|
|
|
RELATIONSHIP_UPDATE: 'relationshipUpdate';
|
2022-05-14 08:06:15 +00:00
|
|
|
UNHANDLED_PACKET: 'unhandledPacket';
|
2023-03-07 16:17:22 +00:00
|
|
|
CAPTCHA_REQUIRED: 'captchaRequired';
|
2022-05-14 08:06:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface WebEmbedOptions {
|
|
|
|
shorten?: boolean;
|
|
|
|
hidden?: boolean;
|
|
|
|
title?: string;
|
|
|
|
description?: string;
|
|
|
|
url?: string;
|
|
|
|
timestamp?: Date | number;
|
|
|
|
color?: ColorResolvable;
|
|
|
|
fields?: EmbedFieldData[];
|
|
|
|
author?: Partial<MessageEmbedAuthor> & { icon_url?: string; proxy_icon_url?: string };
|
|
|
|
thumbnail?: Partial<MessageEmbedThumbnail> & { proxy_url?: string };
|
|
|
|
image?: Partial<MessageEmbedImage> & { proxy_url?: string };
|
|
|
|
video?: Partial<MessageEmbedVideo> & { proxy_url?: string };
|
|
|
|
footer?: Partial<MessageEmbedFooter> & { icon_url?: string; proxy_icon_url?: string };
|
|
|
|
imageType?: 'thumbnail' | 'image';
|
|
|
|
}
|
|
|
|
// export interface MessageOptions
|
|
|
|
// embeds?: (WebEmbed | MessageEmbed | MessageEmbedOptions | APIEmbed)[];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @extends https://luna.gitlab.io/discord-unofficial-docs/user_settings.html
|
|
|
|
*/
|
|
|
|
export interface RawUserSettingsData {
|
|
|
|
afk_timeout?: number;
|
|
|
|
allow_accessibility_detection?: boolean;
|
|
|
|
animate_emoji?: boolean;
|
|
|
|
animate_stickers?: number;
|
2022-06-04 06:26:53 +00:00
|
|
|
contact_sync_enabled?: boolean;
|
2022-05-14 08:06:15 +00:00
|
|
|
convert_emoticons?: boolean;
|
|
|
|
custom_status?: { text?: string; expires_at?: string | null; emoji_name?: string; emoji_id?: Snowflake | null };
|
|
|
|
default_guilds_restricted?: boolean;
|
|
|
|
detect_platform_accounts?: boolean;
|
|
|
|
developer_mode?: boolean;
|
|
|
|
disable_games_tab?: boolean;
|
|
|
|
enable_tts_command?: boolean;
|
|
|
|
explicit_content_filter?: DMScanLevel;
|
|
|
|
friend_discovery_flags?: number;
|
|
|
|
friend_source_flags?: { all?: boolean; mutual_friends?: boolean; mututal_guilds?: boolean };
|
|
|
|
gif_auto_play?: boolean;
|
|
|
|
guild_folders?: { id?: Snowflake; guild_ids?: Snowflake[]; name?: string }[];
|
2022-06-04 06:26:53 +00:00
|
|
|
guild_positions?: number[];
|
2022-05-14 08:06:15 +00:00
|
|
|
inline_attachment_media?: boolean;
|
|
|
|
inline_embed_media?: boolean;
|
|
|
|
locale?: string;
|
|
|
|
message_display_compact?: boolean;
|
|
|
|
native_phone_integration_enabled?: boolean;
|
|
|
|
render_embeds?: boolean;
|
|
|
|
render_reactions?: boolean;
|
|
|
|
restricted_guilds?: any[];
|
|
|
|
show_current_game?: boolean;
|
|
|
|
status?: PresenceStatusData;
|
|
|
|
stream_notifications_enabled?: boolean;
|
|
|
|
theme?: 'dark' | 'light';
|
|
|
|
timezone_offset?: number;
|
|
|
|
view_nsfw_guilds?: boolean;
|
|
|
|
}
|
|
|
|
|
2023-01-08 07:06:42 +00:00
|
|
|
export interface RawGuildSettingsData {
|
|
|
|
guild_id: Snowflake;
|
|
|
|
suppress_everyone: boolean;
|
|
|
|
suppress_roles: boolean;
|
|
|
|
mute_scheduled_events: boolean;
|
|
|
|
message_notifications: 2;
|
|
|
|
flags: 0;
|
|
|
|
mobile_push: boolean;
|
|
|
|
muted: boolean;
|
|
|
|
mute_config?: RawMuteConfigData;
|
|
|
|
hide_muted_channels: boolean;
|
|
|
|
channel_overrides: RawGuildChannelSettingsData[];
|
|
|
|
notify_highlights: number;
|
|
|
|
version: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RawGuildChannelSettingsData {
|
|
|
|
channel_id: Snowflake;
|
|
|
|
message_notifications: number;
|
|
|
|
muted: boolean;
|
|
|
|
mute_config?: RawMuteConfigData;
|
|
|
|
collapsed: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RawMuteConfigData {
|
|
|
|
end_time: string;
|
|
|
|
selected_time_window: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MuteConfigData {
|
|
|
|
endTime: Date;
|
|
|
|
selectedTimeWindow: number;
|
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface ClientOptions {
|
|
|
|
shards?: number | number[] | 'auto';
|
|
|
|
shardCount?: number;
|
2022-06-06 04:21:36 +00:00
|
|
|
closeTimeout?: number;
|
2022-05-14 08:06:15 +00:00
|
|
|
makeCache?: CacheFactory;
|
|
|
|
/** @deprecated Pass the value of this property as `lifetime` to `sweepers.messages` instead. */
|
|
|
|
messageCacheLifetime?: number;
|
|
|
|
/** @deprecated Pass the value of this property as `interval` to `sweepers.messages` instead. */
|
|
|
|
messageSweepInterval?: number;
|
|
|
|
allowedMentions?: MessageMentionOptions;
|
|
|
|
invalidRequestWarningInterval?: number;
|
|
|
|
partials?: PartialTypes[];
|
|
|
|
restWsBridgeTimeout?: number;
|
|
|
|
restTimeOffset?: number;
|
|
|
|
restRequestTimeout?: number;
|
|
|
|
restGlobalRateLimit?: number;
|
|
|
|
restSweepInterval?: number;
|
|
|
|
retryLimit?: number;
|
|
|
|
failIfNotExists?: boolean;
|
|
|
|
userAgentSuffix?: string[];
|
|
|
|
presence?: PresenceData;
|
|
|
|
intents?: BitFieldResolvable<IntentsString, number>;
|
|
|
|
waitGuildTimeout?: number;
|
2022-08-21 02:43:22 +00:00
|
|
|
messageCreateEventGuildTimeout?: number;
|
2022-05-14 08:06:15 +00:00
|
|
|
sweepers?: SweeperOptions;
|
|
|
|
ws?: WebSocketOptions;
|
|
|
|
http?: HTTPOptions;
|
|
|
|
rejectOnRateLimit?: string[] | ((data: RateLimitData) => boolean | Promise<boolean>);
|
|
|
|
// add
|
|
|
|
checkUpdate?: boolean;
|
2023-01-26 06:40:51 +00:00
|
|
|
syncStatus?: boolean;
|
2022-07-09 10:07:01 +00:00
|
|
|
autoRedeemNitro?: boolean;
|
2022-05-21 13:58:33 +00:00
|
|
|
patchVoice?: boolean;
|
2022-11-08 16:56:17 +00:00
|
|
|
password?: string;
|
2022-07-16 09:37:41 +00:00
|
|
|
DMSync?: boolean;
|
2022-08-29 04:10:47 +00:00
|
|
|
proxy?: string;
|
2022-12-04 09:38:15 +00:00
|
|
|
captchaService?: captchaServices;
|
2022-11-04 11:40:19 +00:00
|
|
|
captchaKey?: string;
|
2023-01-03 06:56:24 +00:00
|
|
|
captchaSolver?: (data: Captcha, userAgent: string) => Promise<string>;
|
2023-02-14 16:46:04 +00:00
|
|
|
captchaRetryLimit?: number;
|
2022-11-19 10:59:52 +00:00
|
|
|
interactionTimeout?: number;
|
2022-11-27 12:45:58 +00:00
|
|
|
usingNewAttachmentAPI?: boolean;
|
2022-05-14 08:06:15 +00:00
|
|
|
}
|
|
|
|
|
2023-04-06 12:29:25 +00:00
|
|
|
export type captchaServices = '2captcha' | 'capmonster';
|
2022-12-04 09:38:15 +00:00
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
// end copy
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface BaseApplicationCommandData {
|
|
|
|
name: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
nameLocalizations?: LocalizationMap;
|
2022-06-24 02:14:55 +00:00
|
|
|
/** @deprecated Use {@link defaultMemberPermissions} and {@link dmPermission} instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
defaultPermission?: boolean;
|
2022-06-24 02:14:55 +00:00
|
|
|
defaultMemberPermissions?: PermissionResolvable | null;
|
|
|
|
dmPermission?: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type CommandOptionDataTypeResolvable = ApplicationCommandOptionType | ApplicationCommandOptionTypes;
|
|
|
|
|
|
|
|
export type CommandOptionChannelResolvableType = ApplicationCommandOptionTypes.CHANNEL | 'CHANNEL';
|
|
|
|
|
|
|
|
export type CommandOptionChoiceResolvableType =
|
|
|
|
| ApplicationCommandOptionTypes.STRING
|
|
|
|
| 'STRING'
|
|
|
|
| CommandOptionNumericResolvableType;
|
|
|
|
|
|
|
|
export type CommandOptionNumericResolvableType =
|
|
|
|
| ApplicationCommandOptionTypes.NUMBER
|
|
|
|
| 'NUMBER'
|
|
|
|
| ApplicationCommandOptionTypes.INTEGER
|
|
|
|
| 'INTEGER';
|
|
|
|
|
|
|
|
export type CommandOptionSubOptionResolvableType =
|
|
|
|
| ApplicationCommandOptionTypes.SUB_COMMAND
|
|
|
|
| 'SUB_COMMAND'
|
|
|
|
| ApplicationCommandOptionTypes.SUB_COMMAND_GROUP
|
|
|
|
| 'SUB_COMMAND_GROUP';
|
|
|
|
|
|
|
|
export type CommandOptionNonChoiceResolvableType = Exclude<
|
|
|
|
CommandOptionDataTypeResolvable,
|
|
|
|
CommandOptionChoiceResolvableType | CommandOptionSubOptionResolvableType | CommandOptionChannelResolvableType
|
|
|
|
>;
|
|
|
|
|
|
|
|
export interface BaseApplicationCommandOptionsData {
|
|
|
|
name: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
nameLocalizations?: LocalizationMap;
|
2022-03-19 10:37:45 +00:00
|
|
|
description: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
descriptionLocalizations?: LocalizationMap;
|
2022-03-19 10:37:45 +00:00
|
|
|
required?: boolean;
|
|
|
|
autocomplete?: never;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserApplicationCommandData extends BaseApplicationCommandData {
|
|
|
|
type: 'USER' | ApplicationCommandTypes.USER;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageApplicationCommandData extends BaseApplicationCommandData {
|
|
|
|
type: 'MESSAGE' | ApplicationCommandTypes.MESSAGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ChatInputApplicationCommandData extends BaseApplicationCommandData {
|
|
|
|
description: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
descriptionLocalizations?: LocalizationMap;
|
2022-03-19 10:37:45 +00:00
|
|
|
type?: 'CHAT_INPUT' | ApplicationCommandTypes.CHAT_INPUT;
|
|
|
|
options?: ApplicationCommandOptionData[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ApplicationCommandData =
|
|
|
|
| UserApplicationCommandData
|
|
|
|
| MessageApplicationCommandData
|
|
|
|
| ChatInputApplicationCommandData;
|
|
|
|
|
|
|
|
export interface ApplicationCommandChannelOptionData extends BaseApplicationCommandOptionsData {
|
|
|
|
type: CommandOptionChannelResolvableType;
|
|
|
|
channelTypes?: ExcludeEnum<typeof ChannelTypes, 'UNKNOWN'>[];
|
|
|
|
channel_types?: Exclude<ChannelTypes, ChannelTypes.UNKNOWN>[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandChannelOption extends BaseApplicationCommandOptionsData {
|
|
|
|
type: 'CHANNEL';
|
|
|
|
channelTypes?: (keyof typeof ChannelTypes)[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandAutocompleteOption extends Omit<BaseApplicationCommandOptionsData, 'autocomplete'> {
|
|
|
|
type:
|
2022-04-16 10:44:43 +00:00
|
|
|
| 'STRING'
|
|
|
|
| 'NUMBER'
|
|
|
|
| 'INTEGER'
|
|
|
|
| ApplicationCommandOptionTypes.STRING
|
|
|
|
| ApplicationCommandOptionTypes.NUMBER
|
|
|
|
| ApplicationCommandOptionTypes.INTEGER;
|
2022-03-19 10:37:45 +00:00
|
|
|
autocomplete: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandChoicesData extends Omit<BaseApplicationCommandOptionsData, 'autocomplete'> {
|
|
|
|
type: CommandOptionChoiceResolvableType;
|
2022-05-14 08:06:15 +00:00
|
|
|
choices?: ApplicationCommandOptionChoiceData[];
|
2022-03-19 10:37:45 +00:00
|
|
|
autocomplete?: false;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandChoicesOption extends Omit<BaseApplicationCommandOptionsData, 'autocomplete'> {
|
2022-07-07 09:10:51 +00:00
|
|
|
type: CommandOptionChoiceResolvableType;
|
2022-05-14 08:06:15 +00:00
|
|
|
choices?: ApplicationCommandOptionChoiceData[];
|
2022-03-19 10:37:45 +00:00
|
|
|
autocomplete?: false;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandNumericOptionData extends ApplicationCommandChoicesData {
|
|
|
|
type: CommandOptionNumericResolvableType;
|
|
|
|
minValue?: number;
|
|
|
|
min_value?: number;
|
|
|
|
maxValue?: number;
|
|
|
|
max_value?: number;
|
|
|
|
}
|
|
|
|
|
2022-07-07 09:10:51 +00:00
|
|
|
export interface ApplicationCommandStringOptionData extends ApplicationCommandChoicesData {
|
|
|
|
type: ApplicationCommandOptionTypes.STRING;
|
|
|
|
minLength?: number;
|
|
|
|
min_length?: number;
|
|
|
|
maxLength?: number;
|
|
|
|
max_length?: number;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface ApplicationCommandNumericOption extends ApplicationCommandChoicesOption {
|
2022-07-07 09:10:51 +00:00
|
|
|
type: CommandOptionNumericResolvableType;
|
2022-03-19 10:37:45 +00:00
|
|
|
minValue?: number;
|
|
|
|
maxValue?: number;
|
|
|
|
}
|
|
|
|
|
2022-07-07 09:10:51 +00:00
|
|
|
export interface ApplicationCommandStringOption extends ApplicationCommandChoicesOption {
|
|
|
|
type: ApplicationCommandOptionTypes.STRING;
|
|
|
|
minLength?: number;
|
|
|
|
maxLength?: number;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface ApplicationCommandSubGroupData extends Omit<BaseApplicationCommandOptionsData, 'required'> {
|
|
|
|
type: 'SUB_COMMAND_GROUP' | ApplicationCommandOptionTypes.SUB_COMMAND_GROUP;
|
|
|
|
options?: ApplicationCommandSubCommandData[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandSubGroup extends Omit<BaseApplicationCommandOptionsData, 'required'> {
|
|
|
|
type: 'SUB_COMMAND_GROUP';
|
|
|
|
options?: ApplicationCommandSubCommand[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandSubCommandData extends Omit<BaseApplicationCommandOptionsData, 'required'> {
|
|
|
|
type: 'SUB_COMMAND' | ApplicationCommandOptionTypes.SUB_COMMAND;
|
|
|
|
options?: (
|
|
|
|
| ApplicationCommandChoicesData
|
|
|
|
| ApplicationCommandNonOptionsData
|
|
|
|
| ApplicationCommandChannelOptionData
|
|
|
|
| ApplicationCommandAutocompleteOption
|
|
|
|
| ApplicationCommandNumericOptionData
|
2022-07-07 09:10:51 +00:00
|
|
|
| ApplicationCommandStringOptionData
|
2022-03-19 10:37:45 +00:00
|
|
|
)[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandSubCommand extends Omit<BaseApplicationCommandOptionsData, 'required'> {
|
|
|
|
type: 'SUB_COMMAND';
|
|
|
|
options?: (ApplicationCommandChoicesOption | ApplicationCommandNonOptions | ApplicationCommandChannelOption)[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandNonOptionsData extends BaseApplicationCommandOptionsData {
|
|
|
|
type: CommandOptionNonChoiceResolvableType;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationCommandNonOptions extends BaseApplicationCommandOptionsData {
|
|
|
|
type: Exclude<CommandOptionNonChoiceResolvableType, ApplicationCommandOptionTypes>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ApplicationCommandOptionData =
|
|
|
|
| ApplicationCommandSubGroupData
|
|
|
|
| ApplicationCommandNonOptionsData
|
|
|
|
| ApplicationCommandChannelOptionData
|
|
|
|
| ApplicationCommandChoicesData
|
|
|
|
| ApplicationCommandAutocompleteOption
|
|
|
|
| ApplicationCommandNumericOptionData
|
2022-07-07 09:10:51 +00:00
|
|
|
| ApplicationCommandStringOptionData
|
2022-03-19 10:37:45 +00:00
|
|
|
| ApplicationCommandSubCommandData;
|
|
|
|
|
|
|
|
export type ApplicationCommandOption =
|
|
|
|
| ApplicationCommandSubGroup
|
|
|
|
| ApplicationCommandNonOptions
|
|
|
|
| ApplicationCommandChannelOption
|
|
|
|
| ApplicationCommandChoicesOption
|
|
|
|
| ApplicationCommandNumericOption
|
2022-07-07 09:10:51 +00:00
|
|
|
| ApplicationCommandStringOption
|
2022-03-19 10:37:45 +00:00
|
|
|
| ApplicationCommandSubCommand;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface ApplicationCommandOptionChoiceData {
|
2022-03-19 10:37:45 +00:00
|
|
|
name: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
nameLocalizations?: LocalizationMap;
|
2022-03-19 10:37:45 +00:00
|
|
|
value: string | number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ApplicationCommandType = keyof typeof ApplicationCommandTypes;
|
|
|
|
|
|
|
|
export type ApplicationCommandOptionType = keyof typeof ApplicationCommandOptionTypes;
|
|
|
|
|
2022-12-20 15:46:50 +00:00
|
|
|
export type AutoModerationRuleTriggerType = keyof typeof AutoModerationRuleTriggerTypes;
|
|
|
|
|
|
|
|
export type AutoModerationRuleKeywordPresetType = keyof typeof AutoModerationRuleKeywordPresetTypes;
|
|
|
|
|
|
|
|
export type AutoModerationActionType = keyof typeof AutoModerationActionTypes;
|
|
|
|
|
|
|
|
export type AutoModerationRuleEventType = keyof typeof AutoModerationRuleEventTypes;
|
|
|
|
|
|
|
|
export class AutoModerationActionExecution {
|
|
|
|
private constructor(data: GatewayAutoModerationActionExecutionDispatchData, guild: Guild);
|
|
|
|
public guild: Guild;
|
|
|
|
public action: AutoModerationAction;
|
|
|
|
public ruleId: Snowflake;
|
|
|
|
public ruleTriggerType: AutoModerationRuleTriggerType;
|
|
|
|
public userId: Snowflake;
|
|
|
|
public channelId: Snowflake | 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<true>, 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<Snowflake, Role>;
|
|
|
|
public exemptChannels: Collection<Snowflake, GuildBasedChannel>;
|
|
|
|
public edit(options: AutoModerationRuleEditOptions): Promise<AutoModerationRule>;
|
|
|
|
public delete(reason?: string): Promise<void>;
|
|
|
|
public setName(name: string, reason?: string): Promise<AutoModerationRule>;
|
|
|
|
public setEventType(
|
|
|
|
eventType: AutoModerationRuleEventType | AutoModerationRuleEventTypes,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<AutoModerationRule>;
|
|
|
|
public setKeywordFilter(keywordFilter: string[], reason?: string): Promise<AutoModerationRule>;
|
|
|
|
public setRegexPatterns(regexPatterns: string[], reason?: string): Promise<AutoModerationRule>;
|
|
|
|
public setPresets(presets: AutoModerationRuleKeywordPresetType[], reason?: string): Promise<AutoModerationRule>;
|
|
|
|
public setAllowList(allowList: string[], reason?: string): Promise<AutoModerationRule>;
|
2023-02-12 08:30:49 +00:00
|
|
|
public setMentionRaidProtectionEnabled(
|
|
|
|
mentionRaidProtectionEnabled: boolean,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<AutoModerationRule>;
|
2022-12-20 15:46:50 +00:00
|
|
|
public setMentionTotalLimit(mentionTotalLimit: number, reason?: string): Promise<AutoModerationRule>;
|
2022-12-26 13:38:53 +00:00
|
|
|
public setActions(actions: AutoModerationActionOptions[], reason?: string): Promise<AutoModerationRule>;
|
2022-12-20 15:46:50 +00:00
|
|
|
public setEnabled(enabled?: boolean, reason?: string): Promise<AutoModerationRule>;
|
|
|
|
public setExemptRoles(
|
|
|
|
roles: Collection<Snowflake, Role> | RoleResolvable[],
|
|
|
|
reason?: string,
|
|
|
|
): Promise<AutoModerationRule>;
|
|
|
|
public setExemptChannels(
|
|
|
|
channels: Collection<Snowflake, GuildBasedChannel> | GuildChannelResolvable[],
|
|
|
|
reason?: string,
|
|
|
|
): Promise<AutoModerationRule>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class AutoModerationRuleManager extends CachedManager<
|
|
|
|
Snowflake,
|
|
|
|
AutoModerationRule,
|
|
|
|
AutoModerationRuleResolvable
|
|
|
|
> {
|
|
|
|
private constructor(guild: Guild, iterable: unknown);
|
|
|
|
public guild: Guild;
|
|
|
|
public create(options: AutoModerationRuleCreateOptions): Promise<AutoModerationRule>;
|
|
|
|
public edit(
|
|
|
|
autoModerationRule: AutoModerationRuleResolvable,
|
|
|
|
options: AutoModerationRuleEditOptions,
|
|
|
|
): Promise<AutoModerationRule>;
|
|
|
|
public fetch(options: AutoModerationRuleResolvable | FetchAutoModerationRuleOptions): Promise<AutoModerationRule>;
|
|
|
|
public fetch(options?: FetchAutoModerationRulesOptions): Promise<Collection<Snowflake, AutoModerationRule>>;
|
|
|
|
public delete(autoModerationRule: AutoModerationRuleResolvable, reason?: string): Promise<void>;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface ApplicationCommandPermissionData {
|
|
|
|
id: Snowflake;
|
|
|
|
type: ApplicationCommandPermissionType | ApplicationCommandPermissionTypes;
|
|
|
|
permission: boolean;
|
|
|
|
}
|
|
|
|
|
2023-02-19 05:01:37 +00:00
|
|
|
export interface ApplicationCommandPermissionsUpdateData {
|
|
|
|
permissions: ApplicationCommandPermissions;
|
|
|
|
id: Snowflake;
|
|
|
|
guildId: Snowflake;
|
|
|
|
applicationId: Snowflake;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface ApplicationCommandPermissions extends ApplicationCommandPermissionData {
|
|
|
|
type: ApplicationCommandPermissionType;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ApplicationCommandPermissionType = keyof typeof ApplicationCommandPermissionTypes;
|
|
|
|
|
|
|
|
export type ApplicationCommandResolvable = ApplicationCommand | Snowflake;
|
|
|
|
|
|
|
|
export type ApplicationFlagsString =
|
2023-04-22 06:00:50 +00:00
|
|
|
| 'EMBEDDED_RELEASED'
|
|
|
|
| 'MANAGED_EMOJI'
|
|
|
|
| 'EMBEDDED_IAP'
|
|
|
|
| 'GROUP_DM_CREATE'
|
|
|
|
| 'RPC_PRIVATE_BETA'
|
|
|
|
| 'APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE'
|
|
|
|
| 'ALLOW_ASSETS'
|
|
|
|
| 'ALLOW_ACTIVITY_ACTION_SPECTATE'
|
|
|
|
| 'ALLOW_ACTIVITY_ACTION_JOIN_REQUEST'
|
|
|
|
| 'RPC_HAS_CONNECTED'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'GATEWAY_PRESENCE'
|
|
|
|
| 'GATEWAY_PRESENCE_LIMITED'
|
|
|
|
| 'GATEWAY_GUILD_MEMBERS'
|
|
|
|
| 'GATEWAY_GUILD_MEMBERS_LIMITED'
|
|
|
|
| 'VERIFICATION_PENDING_GUILD_LIMIT'
|
|
|
|
| 'EMBEDDED'
|
|
|
|
| 'GATEWAY_MESSAGE_CONTENT'
|
2022-12-03 18:46:40 +00:00
|
|
|
| 'GATEWAY_MESSAGE_CONTENT_LIMITED'
|
|
|
|
| 'EMBEDDED_FIRST_PARTY'
|
2023-04-22 06:00:50 +00:00
|
|
|
| 'APPLICATION_COMMAND_BADGE'
|
|
|
|
| 'ACTIVE';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
2023-01-26 07:10:27 +00:00
|
|
|
export interface ApplicationRoleConnectionMetadataEditOptions {
|
|
|
|
name: string;
|
|
|
|
nameLocalizations?: LocalizationMap | null;
|
|
|
|
description: string;
|
|
|
|
descriptionLocalizations?: LocalizationMap | null;
|
|
|
|
key: string;
|
|
|
|
type: ApplicationRoleConnectionMetadataTypes;
|
|
|
|
}
|
|
|
|
|
2022-12-20 15:46:50 +00:00
|
|
|
export interface AutoModerationAction {
|
|
|
|
type: AutoModerationActionType | AutoModerationActionTypes;
|
|
|
|
metadata: AutoModerationActionMetadata;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AutoModerationActionMetadata {
|
|
|
|
channelId: Snowflake | null;
|
|
|
|
durationSeconds: number | null;
|
2023-04-14 11:39:56 +00:00
|
|
|
customMessage: string | null;
|
2022-12-20 15:46:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AutoModerationTriggerMetadata {
|
|
|
|
keywordFilter: string[];
|
|
|
|
regexPatterns: string[];
|
|
|
|
presets: (AutoModerationRuleKeywordPresetType | AutoModerationRuleKeywordPresetTypes)[];
|
|
|
|
allowList: string[];
|
2023-02-12 08:30:49 +00:00
|
|
|
mentionRaidProtectionEnabled: boolean;
|
2022-12-20 15:46:50 +00:00
|
|
|
mentionTotalLimit: number | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchAutoModerationRuleOptions extends BaseFetchOptions {
|
|
|
|
autoModerationRule: AutoModerationRuleResolvable;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchAutoModerationRulesOptions {
|
|
|
|
cache?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AutoModerationRuleCreateOptions {
|
|
|
|
name: string;
|
|
|
|
eventType: AutoModerationRuleEventType | AutoModerationRuleEventTypes;
|
|
|
|
triggerType: AutoModerationRuleTriggerType | AutoModerationRuleTriggerTypes;
|
|
|
|
triggerMetadata?: AutoModerationTriggerMetadataOptions;
|
2022-12-26 13:38:53 +00:00
|
|
|
actions: AutoModerationActionOptions[];
|
2022-12-20 15:46:50 +00:00
|
|
|
enabled?: boolean;
|
|
|
|
exemptRoles?: Collection<Snowflake, Role> | RoleResolvable[];
|
|
|
|
exemptChannels?: Collection<Snowflake, GuildBasedChannel> | GuildChannelResolvable[];
|
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AutoModerationRuleEditOptions extends Partial<Omit<AutoModerationRuleCreateOptions, 'triggerType'>> {}
|
|
|
|
|
|
|
|
export interface AutoModerationTriggerMetadataOptions extends Partial<AutoModerationTriggerMetadata> {}
|
|
|
|
|
|
|
|
export interface AutoModerationActionOptions {
|
|
|
|
type: AutoModerationActionType | AutoModerationActionTypes;
|
|
|
|
metadata?: AutoModerationActionMetadataOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AutoModerationActionMetadataOptions extends Partial<Omit<AutoModerationActionMetadata, 'channelId'>> {
|
|
|
|
channel: GuildTextChannelResolvable | ThreadChannel;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface AuditLogChange {
|
|
|
|
key: APIAuditLogChange['key'];
|
|
|
|
old?: APIAuditLogChange['old_value'];
|
|
|
|
new?: APIAuditLogChange['new_value'];
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Awaitable<T> = T | PromiseLike<T>;
|
|
|
|
|
|
|
|
export type AwaitMessageComponentOptions<T extends MessageComponentInteraction> = Omit<
|
|
|
|
MessageComponentCollectorOptions<T>,
|
|
|
|
'max' | 'maxComponents' | 'maxUsers'
|
|
|
|
>;
|
|
|
|
|
|
|
|
export interface AwaitMessagesOptions extends MessageCollectorOptions {
|
|
|
|
errors?: string[];
|
|
|
|
}
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type AwaitModalSubmitOptions<T extends ModalSubmitInteraction> = Omit<
|
|
|
|
ModalSubmitInteractionCollectorOptions<T>,
|
|
|
|
'max' | 'maxComponents' | 'maxUsers'
|
|
|
|
> & {
|
|
|
|
time: number;
|
|
|
|
};
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface AwaitReactionsOptions extends ReactionCollectorOptions {
|
|
|
|
errors?: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BanOptions {
|
2022-09-04 11:31:39 +00:00
|
|
|
/** @deprecated Use {@link deleteMessageSeconds} instead. */
|
2022-03-19 10:37:45 +00:00
|
|
|
days?: number;
|
2022-09-04 11:31:39 +00:00
|
|
|
deleteMessageSeconds?: number;
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Base64Resolvable = Buffer | Base64String;
|
|
|
|
|
|
|
|
export type Base64String = string;
|
|
|
|
|
|
|
|
export interface BaseFetchOptions {
|
|
|
|
cache?: boolean;
|
|
|
|
force?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BaseMessageComponentOptions {
|
|
|
|
type?: MessageComponentType | MessageComponentTypes;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type BitFieldResolvable<T extends string, N extends number | bigint> =
|
|
|
|
| RecursiveReadonlyArray<T | N | `${bigint}` | Readonly<BitField<T, N>>>
|
|
|
|
| T
|
|
|
|
| N
|
|
|
|
| `${bigint}`
|
|
|
|
| Readonly<BitField<T, N>>;
|
|
|
|
|
|
|
|
export type BufferResolvable = Buffer | string;
|
|
|
|
|
|
|
|
export interface Caches {
|
|
|
|
ApplicationCommandManager: [manager: typeof ApplicationCommandManager, holds: typeof ApplicationCommand];
|
2022-12-20 15:46:50 +00:00
|
|
|
AutoModerationRuleManager: [manager: typeof AutoModerationRuleManager, holds: typeof AutoModerationRule];
|
2022-03-19 10:37:45 +00:00
|
|
|
BaseGuildEmojiManager: [manager: typeof BaseGuildEmojiManager, holds: typeof GuildEmoji];
|
|
|
|
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];
|
|
|
|
GuildInviteManager: [manager: typeof GuildInviteManager, holds: typeof Invite];
|
|
|
|
GuildScheduledEventManager: [manager: typeof GuildScheduledEventManager, holds: typeof GuildScheduledEvent];
|
|
|
|
GuildStickerManager: [manager: typeof GuildStickerManager, holds: typeof Sticker];
|
|
|
|
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 };
|
|
|
|
};
|
|
|
|
|
|
|
|
// 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 = (
|
|
|
|
manager: CacheConstructors[keyof Caches],
|
2023-01-26 07:23:17 +00:00
|
|
|
holds: Caches[(typeof manager)['name']][1],
|
|
|
|
) => (typeof manager)['prototype'] extends DataManager<infer K, infer V, any> ? Collection<K, V> : never;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type CacheWithLimitsOptions = {
|
|
|
|
[K in keyof Caches]?: Caches[K][0]['prototype'] extends DataManager<infer K, infer V, any>
|
2022-04-16 10:44:43 +00:00
|
|
|
? LimitedCollectionOptions<K, V> | number
|
|
|
|
: never;
|
2022-03-19 10:37:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export interface CategoryCreateChannelOptions {
|
|
|
|
permissionOverwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
|
|
|
|
topic?: string;
|
|
|
|
type?: ExcludeEnum<
|
|
|
|
typeof ChannelTypes,
|
|
|
|
| 'DM'
|
|
|
|
| 'GROUP_DM'
|
|
|
|
| 'UNKNOWN'
|
|
|
|
| 'GUILD_PUBLIC_THREAD'
|
|
|
|
| 'GUILD_NEWS_THREAD'
|
|
|
|
| 'GUILD_PRIVATE_THREAD'
|
|
|
|
| 'GUILD_CATEGORY'
|
|
|
|
>;
|
|
|
|
nsfw?: boolean;
|
|
|
|
bitrate?: number;
|
|
|
|
userLimit?: number;
|
|
|
|
rateLimitPerUser?: number;
|
|
|
|
position?: number;
|
|
|
|
rtcRegion?: string;
|
2022-10-03 12:25:39 +00:00
|
|
|
videoQualityMode?: VideoQualityMode;
|
|
|
|
availableTags?: GuildForumTagData[];
|
|
|
|
defaultReactionEmoji?: DefaultReactionEmoji;
|
|
|
|
defaultSortOrder?: SortOrderType;
|
2022-12-25 03:35:06 +00:00
|
|
|
defaultForumLayout?: ForumLayoutType;
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ChannelCreationOverwrites {
|
|
|
|
allow?: PermissionResolvable;
|
|
|
|
deny?: PermissionResolvable;
|
|
|
|
id: RoleResolvable | UserResolvable;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ChannelData {
|
|
|
|
name?: string;
|
|
|
|
type?: Pick<typeof ChannelTypes, 'GUILD_TEXT' | 'GUILD_NEWS'>;
|
|
|
|
position?: number;
|
|
|
|
topic?: string;
|
|
|
|
nsfw?: boolean;
|
|
|
|
bitrate?: number;
|
|
|
|
userLimit?: number;
|
|
|
|
parent?: CategoryChannelResolvable | null;
|
|
|
|
rateLimitPerUser?: number;
|
|
|
|
lockPermissions?: boolean;
|
|
|
|
permissionOverwrites?: readonly OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
|
2022-05-14 08:06:15 +00:00
|
|
|
defaultAutoArchiveDuration?: ThreadAutoArchiveDuration | 'MAX';
|
2022-03-19 10:37:45 +00:00
|
|
|
rtcRegion?: string | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
videoQualityMode?: VideoQualityMode | null;
|
2022-10-03 12:25:39 +00:00
|
|
|
availableTags?: GuildForumTagData[];
|
|
|
|
defaultReactionEmoji?: DefaultReactionEmoji;
|
|
|
|
defaultThreadRateLimitPerUser?: number;
|
|
|
|
defaultSortOrder?: SortOrderType | null;
|
2022-12-25 03:35:06 +00:00
|
|
|
defaultForumLayout?: ForumLayoutType;
|
2022-10-03 12:25:39 +00:00
|
|
|
flags?: ChannelFlagsResolvable;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ChannelLogsQueryOptions {
|
|
|
|
limit?: number;
|
|
|
|
before?: Snowflake;
|
|
|
|
after?: Snowflake;
|
|
|
|
around?: Snowflake;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 = AnyChannel | Snowflake;
|
|
|
|
|
|
|
|
export interface ChannelWebhookCreateOptions {
|
|
|
|
avatar?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BaseClientEvents {
|
|
|
|
apiResponse: [request: APIRequest, response: Response];
|
|
|
|
apiRequest: [request: APIRequest];
|
|
|
|
debug: [message: string];
|
|
|
|
rateLimit: [rateLimitData: RateLimitData];
|
|
|
|
invalidRequestWarning: [invalidRequestWarningData: InvalidRequestWarningData];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ClientFetchInviteOptions {
|
|
|
|
guildScheduledEventId?: Snowflake;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ClientPresenceStatus = 'online' | 'idle' | 'dnd';
|
|
|
|
|
|
|
|
export interface ClientPresenceStatusData {
|
|
|
|
web?: ClientPresenceStatus;
|
|
|
|
mobile?: ClientPresenceStatus;
|
|
|
|
desktop?: ClientPresenceStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ClientUserEditData {
|
|
|
|
username?: string;
|
|
|
|
avatar?: BufferResolvable | Base64Resolvable | null;
|
2022-08-04 12:26:16 +00:00
|
|
|
banner?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
bio?: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface CloseEvent {
|
|
|
|
wasClean: boolean;
|
|
|
|
code: number;
|
|
|
|
reason: string;
|
|
|
|
target: WebSocket;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type CollectorFilter<T extends unknown[]> = (...args: T) => boolean | Promise<boolean>;
|
|
|
|
|
|
|
|
export interface CollectorOptions<T extends unknown[]> {
|
|
|
|
filter?: CollectorFilter<T>;
|
|
|
|
time?: number;
|
|
|
|
idle?: number;
|
|
|
|
dispose?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CollectorResetTimerOptions {
|
|
|
|
time?: number;
|
|
|
|
idle?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ColorResolvable =
|
|
|
|
| 'DEFAULT'
|
|
|
|
| 'WHITE'
|
|
|
|
| 'AQUA'
|
|
|
|
| 'GREEN'
|
|
|
|
| 'BLUE'
|
|
|
|
| 'YELLOW'
|
|
|
|
| 'PURPLE'
|
|
|
|
| 'LUMINOUS_VIVID_PINK'
|
|
|
|
| 'FUCHSIA'
|
|
|
|
| 'GOLD'
|
|
|
|
| 'ORANGE'
|
|
|
|
| 'RED'
|
|
|
|
| 'GREY'
|
|
|
|
| 'DARKER_GREY'
|
|
|
|
| 'NAVY'
|
|
|
|
| 'DARK_AQUA'
|
|
|
|
| 'DARK_GREEN'
|
|
|
|
| 'DARK_BLUE'
|
|
|
|
| 'DARK_PURPLE'
|
|
|
|
| 'DARK_VIVID_PINK'
|
|
|
|
| 'DARK_GOLD'
|
|
|
|
| 'DARK_ORANGE'
|
|
|
|
| 'DARK_RED'
|
|
|
|
| 'DARK_GREY'
|
|
|
|
| 'LIGHT_GREY'
|
|
|
|
| 'DARK_NAVY'
|
|
|
|
| 'BLURPLE'
|
|
|
|
| 'GREYPLE'
|
|
|
|
| 'DARK_BUT_NOT_BLACK'
|
|
|
|
| 'NOT_QUITE_BLACK'
|
|
|
|
| 'RANDOM'
|
|
|
|
| readonly [number, number, number]
|
|
|
|
| number
|
|
|
|
| HexColorString;
|
|
|
|
|
|
|
|
export interface CommandInteractionOption<Cached extends CacheType = CacheType> {
|
|
|
|
name: string;
|
|
|
|
type: ApplicationCommandOptionType;
|
|
|
|
value?: string | number | boolean;
|
|
|
|
focused?: boolean;
|
|
|
|
autocomplete?: boolean;
|
|
|
|
options?: CommandInteractionOption[];
|
|
|
|
user?: User;
|
|
|
|
member?: CacheTypeReducer<Cached, GuildMember, APIInteractionDataResolvedGuildMember>;
|
|
|
|
channel?: CacheTypeReducer<Cached, GuildBasedChannel, APIInteractionDataResolvedChannel>;
|
|
|
|
role?: CacheTypeReducer<Cached, Role, APIRole>;
|
|
|
|
message?: GuildCacheMessage<Cached>;
|
2022-05-14 08:06:15 +00:00
|
|
|
attachment?: MessageAttachment;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface CommandInteractionResolvedData<Cached extends CacheType = CacheType> {
|
|
|
|
users?: Collection<Snowflake, User>;
|
|
|
|
members?: Collection<Snowflake, CacheTypeReducer<Cached, GuildMember, APIInteractionDataResolvedGuildMember>>;
|
|
|
|
roles?: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
|
|
|
|
channels?: Collection<Snowflake, CacheTypeReducer<Cached, AnyChannel, APIInteractionDataResolvedChannel>>;
|
|
|
|
messages?: Collection<Snowflake, CacheTypeReducer<Cached, Message, APIMessage>>;
|
2022-05-14 08:06:15 +00:00
|
|
|
attachments?: Collection<Snowflake, MessageAttachment>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ConstantsClientApplicationAssetTypes {
|
|
|
|
SMALL: 1;
|
|
|
|
BIG: 2;
|
|
|
|
}
|
|
|
|
|
2022-06-17 05:48:45 +00:00
|
|
|
export type AutocompleteFocusedOption = Pick<CommandInteractionOption, 'name'> & {
|
|
|
|
focused: true;
|
|
|
|
type:
|
|
|
|
| 'STRING'
|
|
|
|
| 'INTEGER'
|
|
|
|
| 'NUMBER'
|
|
|
|
| ApplicationCommandOptionTypes.STRING
|
|
|
|
| ApplicationCommandOptionTypes.INTEGER
|
|
|
|
| ApplicationCommandOptionTypes.NUMBER;
|
|
|
|
value: string;
|
|
|
|
};
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface ConstantsColors {
|
|
|
|
DEFAULT: 0x000000;
|
|
|
|
WHITE: 0xffffff;
|
|
|
|
AQUA: 0x1abc9c;
|
|
|
|
GREEN: 0x57f287;
|
|
|
|
BLUE: 0x3498db;
|
|
|
|
YELLOW: 0xfee75c;
|
|
|
|
PURPLE: 0x9b59b6;
|
|
|
|
LUMINOUS_VIVID_PINK: 0xe91e63;
|
|
|
|
FUCHSIA: 0xeb459e;
|
|
|
|
GOLD: 0xf1c40f;
|
|
|
|
ORANGE: 0xe67e22;
|
|
|
|
RED: 0xed4245;
|
|
|
|
GREY: 0x95a5a6;
|
|
|
|
NAVY: 0x34495e;
|
|
|
|
DARK_AQUA: 0x11806a;
|
|
|
|
DARK_GREEN: 0x1f8b4c;
|
|
|
|
DARK_BLUE: 0x206694;
|
|
|
|
DARK_PURPLE: 0x71368a;
|
|
|
|
DARK_VIVID_PINK: 0xad1457;
|
|
|
|
DARK_GOLD: 0xc27c0e;
|
|
|
|
DARK_ORANGE: 0xa84300;
|
|
|
|
DARK_RED: 0x992d22;
|
|
|
|
DARK_GREY: 0x979c9f;
|
|
|
|
DARKER_GREY: 0x7f8c8d;
|
|
|
|
LIGHT_GREY: 0xbcc0c0;
|
|
|
|
DARK_NAVY: 0x2c3e50;
|
|
|
|
BLURPLE: 0x5865f2;
|
|
|
|
GREYPLE: 0x99aab5;
|
|
|
|
DARK_BUT_NOT_BLACK: 0x2c2f33;
|
|
|
|
NOT_QUITE_BLACK: 0x23272a;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ConstantsOpcodes {
|
|
|
|
DISPATCH: 0;
|
|
|
|
HEARTBEAT: 1;
|
|
|
|
IDENTIFY: 2;
|
|
|
|
STATUS_UPDATE: 3;
|
|
|
|
VOICE_STATE_UPDATE: 4;
|
|
|
|
VOICE_GUILD_PING: 5;
|
|
|
|
RESUME: 6;
|
|
|
|
RECONNECT: 7;
|
|
|
|
REQUEST_GUILD_MEMBERS: 8;
|
|
|
|
INVALID_SESSION: 9;
|
|
|
|
HELLO: 10;
|
|
|
|
HEARTBEAT_ACK: 11;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ConstantsShardEvents {
|
|
|
|
CLOSE: 'close';
|
|
|
|
DESTROYED: 'destroyed';
|
|
|
|
INVALID_SESSION: 'invalidSession';
|
|
|
|
READY: 'ready';
|
|
|
|
RESUMED: 'resumed';
|
2022-07-01 03:32:37 +00:00
|
|
|
ALL_READY: 'allReady';
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ConstantsStatus {
|
|
|
|
READY: 0;
|
|
|
|
CONNECTING: 1;
|
|
|
|
RECONNECTING: 2;
|
|
|
|
IDLE: 3;
|
|
|
|
NEARLY: 4;
|
|
|
|
DISCONNECTED: 5;
|
2022-07-01 03:32:37 +00:00
|
|
|
WAITING_FOR_GUILDS: 6;
|
|
|
|
IDENTIFYING: 7;
|
|
|
|
RESUMING: 8;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface CreateGuildScheduledEventInviteURLOptions extends CreateInviteOptions {
|
|
|
|
channel?: GuildInvitableChannelResolvable;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CreateRoleOptions extends RoleData {
|
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface StageInstanceCreateOptions {
|
|
|
|
topic: string;
|
|
|
|
privacyLevel?: PrivacyLevel | number;
|
2022-05-14 08:06:15 +00:00
|
|
|
sendStartNotification?: boolean;
|
2023-02-05 07:58:59 +00:00
|
|
|
guildScheduledEvent?: GuildScheduledEventResolvable;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface CrosspostedChannel {
|
|
|
|
channelId: Snowflake;
|
|
|
|
guildId: Snowflake;
|
|
|
|
type: keyof typeof ChannelTypes;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type DateResolvable = Date | number | string;
|
|
|
|
|
|
|
|
export interface DeconstructedSnowflake {
|
|
|
|
timestamp: number;
|
|
|
|
readonly date: Date;
|
|
|
|
workerId: number;
|
|
|
|
processId: number;
|
|
|
|
increment: number;
|
|
|
|
binary: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type DefaultMessageNotificationLevel = keyof typeof DefaultMessageNotificationLevels;
|
|
|
|
|
|
|
|
export type DynamicImageFormat = AllowedImageFormat | 'gif';
|
|
|
|
|
|
|
|
export interface EditGuildTemplateOptions {
|
|
|
|
name?: string;
|
|
|
|
description?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface EmbedAuthorData {
|
|
|
|
name: string;
|
|
|
|
url?: string;
|
|
|
|
iconURL?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface EmbedField {
|
|
|
|
name: string;
|
|
|
|
value: string;
|
|
|
|
inline: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface EmbedFieldData {
|
|
|
|
name: string;
|
|
|
|
value: string;
|
|
|
|
inline?: boolean;
|
|
|
|
}
|
|
|
|
|
2022-03-24 10:55:32 +00:00
|
|
|
export interface EmbedFooterData {
|
|
|
|
text: string;
|
|
|
|
iconURL?: string;
|
|
|
|
}
|
|
|
|
|
2023-01-06 10:39:46 +00:00
|
|
|
export type EmojiIdentifierResolvable =
|
|
|
|
| EmojiResolvable
|
|
|
|
| `${'' | 'a:'}${string}:${Snowflake}`
|
|
|
|
| `<${'' | 'a'}:${string}:${Snowflake}>`
|
|
|
|
| string;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type EmojiResolvable = Snowflake | GuildEmoji | ReactionEmoji;
|
|
|
|
|
|
|
|
export interface ErrorEvent {
|
|
|
|
error: unknown;
|
|
|
|
message: string;
|
|
|
|
type: string;
|
|
|
|
target: WebSocket;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface EscapeMarkdownOptions {
|
|
|
|
codeBlock?: boolean;
|
|
|
|
inlineCode?: boolean;
|
|
|
|
bold?: boolean;
|
|
|
|
italic?: boolean;
|
|
|
|
underline?: boolean;
|
|
|
|
strikethrough?: boolean;
|
|
|
|
spoiler?: boolean;
|
|
|
|
codeBlockContent?: boolean;
|
2022-11-04 12:46:05 +00:00
|
|
|
inlineCodeContent?: boolean;
|
|
|
|
escape?: boolean;
|
|
|
|
heading?: boolean;
|
|
|
|
bulletedList?: boolean;
|
|
|
|
numberedList?: boolean;
|
|
|
|
maskedLink?: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type ExplicitContentFilterLevel = keyof typeof ExplicitContentFilterLevels;
|
|
|
|
|
|
|
|
export interface FetchApplicationCommandOptions extends BaseFetchOptions {
|
|
|
|
guildId?: Snowflake;
|
2022-06-04 06:26:53 +00:00
|
|
|
locale?: localeSetting;
|
2022-05-14 08:06:15 +00:00
|
|
|
withLocalizations?: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchArchivedThreadOptions {
|
|
|
|
type?: 'public' | 'private';
|
|
|
|
fetchAll?: boolean;
|
|
|
|
before?: ThreadChannelResolvable | DateResolvable;
|
|
|
|
limit?: number;
|
|
|
|
}
|
|
|
|
|
2023-01-18 07:24:06 +00:00
|
|
|
export interface FetchChannelThreadsOptions {
|
|
|
|
archived?: boolean;
|
|
|
|
limit?: number;
|
|
|
|
offset?: number;
|
|
|
|
sort_by?: string;
|
|
|
|
sort_order?: string;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface FetchBanOptions extends BaseFetchOptions {
|
|
|
|
user: UserResolvable;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchBansOptions {
|
2022-05-14 08:06:15 +00:00
|
|
|
limit?: number;
|
|
|
|
before?: Snowflake;
|
|
|
|
after?: Snowflake;
|
|
|
|
cache?: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchChannelOptions extends BaseFetchOptions {
|
|
|
|
allowUnknownGuild?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchedThreads {
|
|
|
|
threads: Collection<Snowflake, ThreadChannel>;
|
|
|
|
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;
|
|
|
|
force?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FetchReactionUsersOptions {
|
|
|
|
limit?: number;
|
|
|
|
after?: Snowflake;
|
|
|
|
}
|
|
|
|
|
2023-02-05 08:14:42 +00:00
|
|
|
export interface FetchThreadMemberOptions extends BaseFetchOptions {
|
|
|
|
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;
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface FetchThreadsOptions {
|
|
|
|
archived?: FetchArchivedThreadOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FileOptions {
|
|
|
|
attachment: BufferResolvable | Stream;
|
|
|
|
name?: string;
|
|
|
|
description?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GlobalSweepFilter<K, V> = () => ((value: V, key: K, collection: Collection<K, V>) => boolean) | null;
|
|
|
|
|
|
|
|
export interface GuildApplicationCommandPermissionData {
|
|
|
|
id: Snowflake;
|
|
|
|
permissions: ApplicationCommandPermissionData[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GuildAuditLogsTypes {
|
|
|
|
GUILD_UPDATE: ['GUILD', 'UPDATE'];
|
|
|
|
CHANNEL_CREATE: ['CHANNEL', 'CREATE'];
|
|
|
|
CHANNEL_UPDATE: ['CHANNEL', 'UPDATE'];
|
|
|
|
CHANNEL_DELETE: ['CHANNEL', 'DELETE'];
|
|
|
|
CHANNEL_OVERWRITE_CREATE: ['CHANNEL', 'CREATE'];
|
|
|
|
CHANNEL_OVERWRITE_UPDATE: ['CHANNEL', 'UPDATE'];
|
|
|
|
CHANNEL_OVERWRITE_DELETE: ['CHANNEL', 'DELETE'];
|
|
|
|
MEMBER_KICK: ['USER', 'DELETE'];
|
|
|
|
MEMBER_PRUNE: ['USER', 'DELETE'];
|
|
|
|
MEMBER_BAN_ADD: ['USER', 'DELETE'];
|
|
|
|
MEMBER_BAN_REMOVE: ['USER', 'CREATE'];
|
|
|
|
MEMBER_UPDATE: ['USER', 'UPDATE'];
|
|
|
|
MEMBER_ROLE_UPDATE: ['USER', 'UPDATE'];
|
|
|
|
MEMBER_MOVE: ['USER', 'UPDATE'];
|
|
|
|
MEMBER_DISCONNECT: ['USER', 'DELETE'];
|
|
|
|
BOT_ADD: ['USER', 'CREATE'];
|
|
|
|
ROLE_CREATE: ['ROLE', 'CREATE'];
|
|
|
|
ROLE_UPDATE: ['ROLE', 'UPDATE'];
|
|
|
|
ROLE_DELETE: ['ROLE', 'DELETE'];
|
|
|
|
INVITE_CREATE: ['INVITE', 'CREATE'];
|
|
|
|
INVITE_UPDATE: ['INVITE', 'UPDATE'];
|
|
|
|
INVITE_DELETE: ['INVITE', 'DELETE'];
|
|
|
|
WEBHOOK_CREATE: ['WEBHOOK', 'CREATE'];
|
|
|
|
WEBHOOK_UPDATE: ['WEBHOOK', 'UPDATE'];
|
|
|
|
WEBHOOK_DELETE: ['WEBHOOK', 'DELETE'];
|
|
|
|
EMOJI_CREATE: ['EMOJI', 'CREATE'];
|
|
|
|
EMOJI_UPDATE: ['EMOJI', 'UPDATE'];
|
|
|
|
EMOJI_DELETE: ['EMOJI', 'DELETE'];
|
|
|
|
MESSAGE_DELETE: ['MESSAGE', 'DELETE'];
|
|
|
|
MESSAGE_BULK_DELETE: ['MESSAGE', 'DELETE'];
|
|
|
|
MESSAGE_PIN: ['MESSAGE', 'CREATE'];
|
|
|
|
MESSAGE_UNPIN: ['MESSAGE', 'DELETE'];
|
|
|
|
INTEGRATION_CREATE: ['INTEGRATION', 'CREATE'];
|
|
|
|
INTEGRATION_UPDATE: ['INTEGRATION', 'UPDATE'];
|
|
|
|
INTEGRATION_DELETE: ['INTEGRATION', 'DELETE'];
|
|
|
|
STAGE_INSTANCE_CREATE: ['STAGE_INSTANCE', 'CREATE'];
|
|
|
|
STAGE_INSTANCE_UPDATE: ['STAGE_INSTANCE', 'UPDATE'];
|
|
|
|
STAGE_INSTANCE_DELETE: ['STAGE_INSTANCE', 'DELETE'];
|
|
|
|
STICKER_CREATE: ['STICKER', 'CREATE'];
|
|
|
|
STICKER_UPDATE: ['STICKER', 'UPDATE'];
|
|
|
|
STICKER_DELETE: ['STICKER', 'DELETE'];
|
|
|
|
GUILD_SCHEDULED_EVENT_CREATE: ['GUILD_SCHEDULED_EVENT', 'CREATE'];
|
|
|
|
GUILD_SCHEDULED_EVENT_UPDATE: ['GUILD_SCHEDULED_EVENT', 'UPDATE'];
|
|
|
|
GUILD_SCHEDULED_EVENT_DELETE: ['GUILD_SCHEDULED_EVENT', 'DELETE'];
|
|
|
|
THREAD_CREATE: ['THREAD', 'CREATE'];
|
|
|
|
THREAD_UPDATE: ['THREAD', 'UPDATE'];
|
|
|
|
THREAD_DELETE: ['THREAD', 'DELETE'];
|
2023-02-19 05:01:37 +00:00
|
|
|
APPLICATION_COMMAND_PERMISSION_UPDATE: ['APPLICATION_COMMAND_PERMISSION', 'UPDATE'];
|
2022-12-20 15:46:50 +00:00
|
|
|
AUTO_MODERATION_RULE_CREATE: ['AUTO_MODERATION', 'CREATE'];
|
|
|
|
AUTO_MODERATION_RULE_UPDATE: ['AUTO_MODERATION', 'UPDATE'];
|
|
|
|
AUTO_MODERATION_RULE_DELETE: ['AUTO_MODERATION', 'DELETE'];
|
|
|
|
AUTO_MODERATION_BLOCK_MESSAGE: ['AUTO_MODERATION', 'CREATE'];
|
|
|
|
AUTO_MODERATION_FLAG_TO_CHANNEL: ['AUTO_MODERATION', 'CREATE'];
|
|
|
|
AUTO_MODERATION_USER_COMMUNICATION_DISABLED: ['AUTO_MODERATION', 'CREATE'];
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildAuditLogsIds {
|
|
|
|
1: 'GUILD_UPDATE';
|
|
|
|
10: 'CHANNEL_CREATE';
|
|
|
|
11: 'CHANNEL_UPDATE';
|
|
|
|
12: 'CHANNEL_DELETE';
|
|
|
|
13: 'CHANNEL_OVERWRITE_CREATE';
|
|
|
|
14: 'CHANNEL_OVERWRITE_UPDATE';
|
|
|
|
15: 'CHANNEL_OVERWRITE_DELETE';
|
|
|
|
20: 'MEMBER_KICK';
|
|
|
|
21: 'MEMBER_PRUNE';
|
|
|
|
22: 'MEMBER_BAN_ADD';
|
|
|
|
23: 'MEMBER_BAN_REMOVE';
|
|
|
|
24: 'MEMBER_UPDATE';
|
|
|
|
25: 'MEMBER_ROLE_UPDATE';
|
|
|
|
26: 'MEMBER_MOVE';
|
|
|
|
27: 'MEMBER_DISCONNECT';
|
|
|
|
28: 'BOT_ADD';
|
|
|
|
30: 'ROLE_CREATE';
|
|
|
|
31: 'ROLE_UPDATE';
|
|
|
|
32: 'ROLE_DELETE';
|
|
|
|
40: 'INVITE_CREATE';
|
|
|
|
41: 'INVITE_UPDATE';
|
|
|
|
42: 'INVITE_DELETE';
|
|
|
|
50: 'WEBHOOK_CREATE';
|
|
|
|
51: 'WEBHOOK_UPDATE';
|
|
|
|
52: 'WEBHOOK_DELETE';
|
|
|
|
60: 'EMOJI_CREATE';
|
|
|
|
61: 'EMOJI_UPDATE';
|
|
|
|
62: 'EMOJI_DELETE';
|
|
|
|
72: 'MESSAGE_DELETE';
|
|
|
|
73: 'MESSAGE_BULK_DELETE';
|
|
|
|
74: 'MESSAGE_PIN';
|
|
|
|
75: 'MESSAGE_UNPIN';
|
|
|
|
80: 'INTEGRATION_CREATE';
|
|
|
|
81: 'INTEGRATION_UPDATE';
|
|
|
|
82: 'INTEGRATION_DELETE';
|
|
|
|
83: 'STAGE_INSTANCE_CREATE';
|
|
|
|
84: 'STAGE_INSTANCE_UPDATE';
|
|
|
|
85: 'STAGE_INSTANCE_DELETE';
|
|
|
|
90: 'STICKER_CREATE';
|
|
|
|
91: 'STICKER_UPDATE';
|
|
|
|
92: 'STICKER_DELETE';
|
|
|
|
100: 'GUILD_SCHEDULED_EVENT_CREATE';
|
|
|
|
101: 'GUILD_SCHEDULED_EVENT_UPDATE';
|
|
|
|
102: 'GUILD_SCHEDULED_EVENT_DELETE';
|
|
|
|
110: 'THREAD_CREATE';
|
|
|
|
111: 'THREAD_UPDATE';
|
|
|
|
112: 'THREAD_DELETE';
|
2023-02-19 05:01:37 +00:00
|
|
|
121: 'APPLICATION_COMMAND_PERMISSION_UPDATE';
|
2022-12-20 15:46:50 +00:00
|
|
|
140: 'AUTO_MODERATION_RULE_CREATE';
|
|
|
|
141: 'AUTO_MODERATION_RULE_UPDATE';
|
|
|
|
142: 'AUTO_MODERATION_RULE_DELETE';
|
|
|
|
143: 'AUTO_MODERATION_BLOCK_MESSAGE';
|
|
|
|
144: 'AUTO_MODERATION_FLAG_TO_CHANNEL';
|
|
|
|
145: 'AUTO_MODERATION_USER_COMMUNICATION_DISABLED';
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildAuditLogsActions = { [Key in keyof GuildAuditLogsIds as GuildAuditLogsIds[Key]]: Key } & { ALL: null };
|
|
|
|
|
|
|
|
export type GuildAuditLogsAction = keyof GuildAuditLogsActions;
|
|
|
|
|
|
|
|
export type GuildAuditLogsActionType = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][1] | 'ALL';
|
|
|
|
|
|
|
|
export interface GuildAuditLogsEntryExtraField {
|
|
|
|
MEMBER_PRUNE: { removed: number; days: number };
|
|
|
|
MEMBER_MOVE: { channel: VoiceBasedChannel | { id: Snowflake }; count: number };
|
|
|
|
MESSAGE_DELETE: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number };
|
|
|
|
MESSAGE_BULK_DELETE: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number };
|
|
|
|
MESSAGE_PIN: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake };
|
|
|
|
MESSAGE_UNPIN: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake };
|
|
|
|
MEMBER_DISCONNECT: { count: number };
|
|
|
|
CHANNEL_OVERWRITE_CREATE:
|
2022-04-16 10:44:43 +00:00
|
|
|
| Role
|
|
|
|
| GuildMember
|
|
|
|
| { id: Snowflake; name: string; type: OverwriteTypes.role }
|
|
|
|
| { id: Snowflake; type: OverwriteTypes.member };
|
2022-03-19 10:37:45 +00:00
|
|
|
CHANNEL_OVERWRITE_UPDATE:
|
2022-04-16 10:44:43 +00:00
|
|
|
| Role
|
|
|
|
| GuildMember
|
|
|
|
| { id: Snowflake; name: string; type: OverwriteTypes.role }
|
|
|
|
| { id: Snowflake; type: OverwriteTypes.member };
|
2022-03-19 10:37:45 +00:00
|
|
|
CHANNEL_OVERWRITE_DELETE:
|
2022-04-16 10:44:43 +00:00
|
|
|
| Role
|
|
|
|
| GuildMember
|
|
|
|
| { id: Snowflake; name: string; type: OverwriteTypes.role }
|
|
|
|
| { id: Snowflake; type: OverwriteTypes.member };
|
2022-03-19 10:37:45 +00:00
|
|
|
STAGE_INSTANCE_CREATE: StageChannel | { id: Snowflake };
|
|
|
|
STAGE_INSTANCE_DELETE: StageChannel | { id: Snowflake };
|
|
|
|
STAGE_INSTANCE_UPDATE: StageChannel | { id: Snowflake };
|
2023-02-19 05:01:37 +00:00
|
|
|
APPLICATION_COMMAND_PERMISSION_UPDATE: {
|
|
|
|
applicationId: Snowflake;
|
|
|
|
};
|
2022-12-20 15:46:50 +00:00
|
|
|
AUTO_MODERATION_BLOCK_MESSAGE: {
|
|
|
|
autoModerationRuleName: string;
|
|
|
|
autoModerationRuleTriggerType: AutoModerationRuleTriggerType;
|
|
|
|
};
|
|
|
|
AUTO_MODERATION_FLAG_TO_CHANNEL: {
|
|
|
|
autoModerationRuleName: string;
|
|
|
|
autoModerationRuleTriggerType: AutoModerationRuleTriggerType;
|
|
|
|
};
|
|
|
|
AUTO_MODERATION_USER_COMMUNICATIONDISABLED: {
|
|
|
|
autoModerationRuleName: string;
|
|
|
|
autoModerationRuleTriggerType: AutoModerationRuleTriggerType;
|
|
|
|
};
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildAuditLogsEntryTargetField<TActionType extends GuildAuditLogsActionType> {
|
|
|
|
USER: User | null;
|
|
|
|
GUILD: Guild;
|
|
|
|
WEBHOOK: Webhook;
|
|
|
|
INVITE: Invite;
|
|
|
|
MESSAGE: TActionType extends 'MESSAGE_BULK_DELETE' ? Guild | { id: Snowflake } : User;
|
|
|
|
INTEGRATION: Integration;
|
2022-04-16 10:44:43 +00:00
|
|
|
CHANNEL: NonThreadGuildBasedChannel | { id: Snowflake; [x: string]: unknown };
|
|
|
|
THREAD: ThreadChannel | { id: Snowflake; [x: string]: unknown };
|
2022-03-19 10:37:45 +00:00
|
|
|
STAGE_INSTANCE: StageInstance;
|
|
|
|
STICKER: Sticker;
|
|
|
|
GUILD_SCHEDULED_EVENT: GuildScheduledEvent;
|
2023-02-19 05:01:37 +00:00
|
|
|
APPLICATION_COMMAND: ApplicationCommand | { id: Snowflake };
|
2022-12-20 15:46:50 +00:00
|
|
|
AUTO_MODERATION: AutoModerationRule;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildAuditLogsFetchOptions<T extends GuildAuditLogsResolvable> {
|
|
|
|
before?: Snowflake | GuildAuditLogsEntry;
|
2023-01-06 11:14:41 +00:00
|
|
|
after?: Snowflake | GuildAuditLogsEntry;
|
2022-03-19 10:37:45 +00:00
|
|
|
limit?: number;
|
|
|
|
user?: UserResolvable;
|
|
|
|
type?: T;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildAuditLogsResolvable = keyof GuildAuditLogsIds | GuildAuditLogsAction | null;
|
|
|
|
|
|
|
|
export type GuildAuditLogsTarget = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][0] | 'ALL' | 'UNKNOWN';
|
|
|
|
|
|
|
|
export type GuildAuditLogsTargets = {
|
|
|
|
[key in GuildAuditLogsTarget]?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type GuildBanResolvable = GuildBan | UserResolvable;
|
|
|
|
|
|
|
|
export interface GuildChannelOverwriteOptions {
|
|
|
|
reason?: string;
|
|
|
|
type?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildChannelResolvable = Snowflake | GuildBasedChannel;
|
|
|
|
|
|
|
|
export interface GuildChannelCreateOptions extends Omit<CategoryCreateChannelOptions, 'type'> {
|
|
|
|
parent?: CategoryChannelResolvable;
|
|
|
|
type?: ExcludeEnum<
|
|
|
|
typeof ChannelTypes,
|
|
|
|
'DM' | 'GROUP_DM' | 'UNKNOWN' | 'GUILD_PUBLIC_THREAD' | 'GUILD_NEWS_THREAD' | 'GUILD_PRIVATE_THREAD'
|
|
|
|
>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildChannelCloneOptions extends GuildChannelCreateOptions {
|
|
|
|
name?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildChannelOverwriteOptions {
|
|
|
|
reason?: string;
|
|
|
|
type?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildCreateOptions {
|
|
|
|
afkChannelId?: Snowflake | number;
|
|
|
|
afkTimeout?: number;
|
|
|
|
channels?: PartialChannelData[];
|
|
|
|
defaultMessageNotifications?: DefaultMessageNotificationLevel | number;
|
|
|
|
explicitContentFilter?: ExplicitContentFilterLevel | number;
|
|
|
|
icon?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
roles?: PartialRoleData[];
|
|
|
|
systemChannelFlags?: SystemChannelFlagsResolvable;
|
|
|
|
systemChannelId?: Snowflake | number;
|
|
|
|
verificationLevel?: VerificationLevel | number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildWidgetSettings {
|
|
|
|
enabled: boolean;
|
|
|
|
channel: NonThreadGuildBasedChannel | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildEditData {
|
|
|
|
name?: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
verificationLevel?: VerificationLevel | number | null;
|
|
|
|
explicitContentFilter?: ExplicitContentFilterLevel | number | null;
|
|
|
|
defaultMessageNotifications?: DefaultMessageNotificationLevel | number | null;
|
|
|
|
afkChannel?: VoiceChannelResolvable | null;
|
|
|
|
systemChannel?: TextChannelResolvable | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
systemChannelFlags?: SystemChannelFlagsResolvable;
|
|
|
|
afkTimeout?: number;
|
|
|
|
icon?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
owner?: GuildMemberResolvable;
|
|
|
|
splash?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
discoverySplash?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
banner?: BufferResolvable | Base64Resolvable | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
rulesChannel?: TextChannelResolvable | null;
|
|
|
|
publicUpdatesChannel?: TextChannelResolvable | null;
|
|
|
|
preferredLocale?: string | null;
|
2023-02-12 08:30:49 +00:00
|
|
|
safetyAlertsChannel?: TextChannelResolvable | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
premiumProgressBarEnabled?: boolean;
|
|
|
|
description?: string | null;
|
|
|
|
features?: GuildFeatures[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildEmojiCreateOptions {
|
|
|
|
roles?: Collection<Snowflake, Role> | RoleResolvable[];
|
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildEmojiEditData {
|
|
|
|
name?: string;
|
|
|
|
roles?: Collection<Snowflake, Role> | RoleResolvable[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildStickerCreateOptions {
|
|
|
|
description?: string | null;
|
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildStickerEditData {
|
|
|
|
name?: string;
|
|
|
|
description?: string | null;
|
|
|
|
tags?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildFeatures =
|
|
|
|
| 'ANIMATED_ICON'
|
2023-01-26 06:48:53 +00:00
|
|
|
| 'AUTO_MODERATION'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'BANNER'
|
2023-04-02 06:18:35 +00:00
|
|
|
| 'CLYDE_ENABLED'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'COMMERCE'
|
|
|
|
| 'COMMUNITY'
|
2023-01-26 06:48:53 +00:00
|
|
|
| 'CREATOR_MONETIZABLE_PROVISIONAL'
|
|
|
|
| 'CREATOR_STORE_PAGE'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'DISCOVERABLE'
|
|
|
|
| 'FEATURABLE'
|
2022-08-11 03:52:43 +00:00
|
|
|
| 'INVITES_DISABLED'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'INVITE_SPLASH'
|
|
|
|
| 'MEMBER_VERIFICATION_GATE_ENABLED'
|
|
|
|
| 'NEWS'
|
|
|
|
| 'PARTNERED'
|
|
|
|
| 'PREVIEW_ENABLED'
|
|
|
|
| 'VANITY_URL'
|
|
|
|
| 'VERIFIED'
|
|
|
|
| 'VIP_REGIONS'
|
|
|
|
| 'WELCOME_SCREEN_ENABLED'
|
|
|
|
| 'TICKETED_EVENTS_ENABLED'
|
|
|
|
| 'MORE_STICKERS'
|
|
|
|
| 'THREE_DAY_THREAD_ARCHIVE'
|
|
|
|
| 'SEVEN_DAY_THREAD_ARCHIVE'
|
|
|
|
| 'PRIVATE_THREADS'
|
2023-04-06 11:00:17 +00:00
|
|
|
| 'RAID_ALERTS_ENABLED'
|
2023-01-14 11:05:40 +00:00
|
|
|
| 'ROLE_ICONS'
|
2023-01-26 06:48:53 +00:00
|
|
|
| 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE'
|
|
|
|
| 'ROLE_SUBSCRIPTIONS_ENABLED';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface GuildMemberEditData {
|
|
|
|
nick?: string | null;
|
|
|
|
roles?: Collection<Snowflake, Role> | readonly RoleResolvable[];
|
|
|
|
mute?: boolean;
|
|
|
|
deaf?: boolean;
|
|
|
|
channel?: GuildVoiceChannelResolvable | null;
|
|
|
|
communicationDisabledUntil?: DateResolvable | null;
|
2023-02-19 05:07:03 +00:00
|
|
|
flags?: GuildMemberFlagsResolvable;
|
2022-08-04 12:26:16 +00:00
|
|
|
avatar?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
banner?: BufferResolvable | Base64Resolvable | null;
|
|
|
|
bio?: string | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2023-02-19 05:07:03 +00:00
|
|
|
export type GuildMemberFlagsString =
|
|
|
|
| 'DID_REJOIN'
|
|
|
|
| 'COMPLETED_ONBOARDING'
|
|
|
|
| 'BYPASSES_VERIFICATION'
|
|
|
|
| 'STARTED_ONBOARDING';
|
|
|
|
|
|
|
|
export type GuildMemberFlagsResolvable = BitFieldResolvable<GuildMemberFlagsString, number>;
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
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: GuildChannelResolvable | 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 | number;
|
|
|
|
entityType: GuildScheduledEventEntityType | number;
|
|
|
|
description?: string;
|
|
|
|
channel?: GuildVoiceChannelResolvable;
|
|
|
|
entityMetadata?: GuildScheduledEventEntityMetadataOptions;
|
2022-05-14 08:06:15 +00:00
|
|
|
image?: BufferResolvable | Base64Resolvable | null;
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildScheduledEventEditOptions<
|
|
|
|
S extends GuildScheduledEventStatus,
|
|
|
|
T extends GuildScheduledEventSetStatusArg<S>,
|
2022-04-16 10:44:43 +00:00
|
|
|
> extends Omit<Partial<GuildScheduledEventCreateOptions>, 'channel'> {
|
2022-03-19 10:37:45 +00:00
|
|
|
channel?: GuildVoiceChannelResolvable | null;
|
|
|
|
status?: T | number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildScheduledEventEntityMetadata {
|
|
|
|
location: string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GuildScheduledEventEntityMetadataOptions {
|
|
|
|
location?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildScheduledEventEntityType = keyof typeof GuildScheduledEventEntityTypes;
|
|
|
|
|
|
|
|
export type GuildScheduledEventManagerFetchResult<
|
|
|
|
T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions | FetchGuildScheduledEventsOptions,
|
2022-04-16 10:44:43 +00:00
|
|
|
> = T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions
|
2022-03-19 10:37:45 +00:00
|
|
|
? GuildScheduledEvent
|
|
|
|
: Collection<Snowflake, GuildScheduledEvent>;
|
|
|
|
|
|
|
|
export type GuildScheduledEventManagerFetchSubscribersResult<T extends FetchGuildScheduledEventSubscribersOptions> =
|
|
|
|
T extends { withMember: true }
|
2022-04-16 10:44:43 +00:00
|
|
|
? Collection<Snowflake, GuildScheduledEventUser<true>>
|
|
|
|
: Collection<Snowflake, GuildScheduledEventUser<false>>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type GuildScheduledEventPrivacyLevel = keyof typeof GuildScheduledEventPrivacyLevels;
|
|
|
|
|
|
|
|
export type GuildScheduledEventResolvable = Snowflake | GuildScheduledEvent;
|
|
|
|
|
|
|
|
export type GuildScheduledEventSetStatusArg<T extends GuildScheduledEventStatus> = T extends 'SCHEDULED'
|
|
|
|
? 'ACTIVE' | 'CANCELED'
|
|
|
|
: T extends 'ACTIVE'
|
|
|
|
? 'COMPLETED'
|
|
|
|
: never;
|
|
|
|
|
|
|
|
export type GuildScheduledEventStatus = keyof typeof GuildScheduledEventStatuses;
|
|
|
|
|
|
|
|
export interface GuildScheduledEventUser<T> {
|
|
|
|
guildScheduledEventId: Snowflake;
|
|
|
|
user: User;
|
|
|
|
member: T extends true ? GuildMember : null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildTemplateResolvable = string;
|
|
|
|
|
|
|
|
export type GuildVoiceChannelResolvable = VoiceBasedChannel | Snowflake;
|
|
|
|
|
|
|
|
export type HexColorString = `#${string}`;
|
|
|
|
|
|
|
|
export interface HTTPAttachmentData {
|
|
|
|
attachment: string | Buffer | Stream;
|
|
|
|
name: string;
|
|
|
|
file: Buffer | Stream;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface HTTPErrorData {
|
|
|
|
json: unknown;
|
|
|
|
files: HTTPAttachmentData[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface HTTPOptions {
|
|
|
|
agent?: Omit<AgentOptions, 'keepAlive'>;
|
|
|
|
api?: string;
|
|
|
|
version?: number;
|
|
|
|
host?: string;
|
|
|
|
cdn?: string;
|
|
|
|
invite?: string;
|
|
|
|
template?: string;
|
|
|
|
headers?: Record<string, string>;
|
|
|
|
scheduledEvent?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ImageURLOptions extends Omit<StaticImageURLOptions, 'format'> {
|
|
|
|
dynamic?: boolean;
|
|
|
|
format?: DynamicImageFormat;
|
|
|
|
}
|
|
|
|
|
2023-01-26 06:48:53 +00:00
|
|
|
export type IntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface InteractionCollectorOptions<T extends Interaction, Cached extends CacheType = CacheType>
|
|
|
|
extends CollectorOptions<[T]> {
|
2022-05-14 08:06:15 +00:00
|
|
|
channel?: TextBasedChannelResolvable;
|
2022-03-19 10:37:45 +00:00
|
|
|
componentType?: MessageComponentType | MessageComponentTypes;
|
2022-05-14 08:06:15 +00:00
|
|
|
guild?: GuildResolvable;
|
2022-03-19 10:37:45 +00:00
|
|
|
interactionType?: InteractionType | InteractionTypes;
|
|
|
|
max?: number;
|
|
|
|
maxComponents?: number;
|
|
|
|
maxUsers?: number;
|
|
|
|
message?: CacheTypeReducer<Cached, Message, APIMessage>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface InteractionDeferReplyOptions {
|
|
|
|
ephemeral?: boolean;
|
|
|
|
fetchReply?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type InteractionDeferUpdateOptions = Omit<InteractionDeferReplyOptions, 'ephemeral'>;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface InteractionReplyOptions extends Omit<WebhookMessageOptions, 'username' | 'avatarURL' | 'flags'> {
|
2022-03-19 10:37:45 +00:00
|
|
|
ephemeral?: boolean;
|
|
|
|
fetchReply?: boolean;
|
2022-05-14 08:06:15 +00:00
|
|
|
flags?: BitFieldResolvable<'SUPPRESS_EMBEDS' | 'EPHEMERAL', number>;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type InteractionResponseType = keyof typeof InteractionResponseTypes;
|
|
|
|
|
|
|
|
export type InteractionType = keyof typeof InteractionTypes;
|
|
|
|
|
|
|
|
export interface InteractionUpdateOptions extends MessageEditOptions {
|
|
|
|
fetchReply?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type IntentsString =
|
|
|
|
| 'GUILDS'
|
|
|
|
| 'GUILD_MEMBERS'
|
|
|
|
| 'GUILD_BANS'
|
|
|
|
| 'GUILD_EMOJIS_AND_STICKERS'
|
|
|
|
| 'GUILD_INTEGRATIONS'
|
|
|
|
| 'GUILD_WEBHOOKS'
|
|
|
|
| 'GUILD_INVITES'
|
|
|
|
| 'GUILD_VOICE_STATES'
|
|
|
|
| 'GUILD_PRESENCES'
|
|
|
|
| 'GUILD_MESSAGES'
|
|
|
|
| 'GUILD_MESSAGE_REACTIONS'
|
|
|
|
| 'GUILD_MESSAGE_TYPING'
|
|
|
|
| 'DIRECT_MESSAGES'
|
|
|
|
| 'DIRECT_MESSAGE_REACTIONS'
|
|
|
|
| 'DIRECT_MESSAGE_TYPING'
|
2022-09-04 11:24:19 +00:00
|
|
|
| 'MESSAGE_CONTENT'
|
2022-12-20 15:46:50 +00:00
|
|
|
| 'GUILD_SCHEDULED_EVENTS'
|
|
|
|
| 'AUTO_MODERATION_CONFIGURATION'
|
|
|
|
| 'AUTO_MODERATION_EXECUTION';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface InviteGenerationOptions {
|
|
|
|
permissions?: PermissionResolvable;
|
|
|
|
guild?: GuildResolvable;
|
|
|
|
disableGuildSelect?: boolean;
|
|
|
|
scopes: InviteScope[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildInvitableChannelResolvable =
|
|
|
|
| TextChannel
|
|
|
|
| VoiceChannel
|
|
|
|
| NewsChannel
|
|
|
|
| StoreChannel
|
|
|
|
| StageChannel
|
|
|
|
| Snowflake;
|
|
|
|
|
|
|
|
export interface CreateInviteOptions {
|
|
|
|
temporary?: boolean;
|
|
|
|
maxAge?: number;
|
|
|
|
maxUses?: number;
|
|
|
|
unique?: boolean;
|
|
|
|
reason?: string;
|
|
|
|
targetApplication?: ApplicationResolvable;
|
|
|
|
targetUser?: UserResolvable;
|
|
|
|
targetType?: InviteTargetType;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type IntegrationExpireBehaviors = 'REMOVE_ROLE' | 'KICK';
|
|
|
|
|
|
|
|
export type InviteResolvable = string;
|
|
|
|
|
|
|
|
export type InviteScope =
|
|
|
|
| 'applications.builds.read'
|
|
|
|
| 'applications.commands'
|
|
|
|
| 'applications.entitlements'
|
|
|
|
| 'applications.store.update'
|
|
|
|
| 'bot'
|
|
|
|
| 'connections'
|
|
|
|
| 'email'
|
|
|
|
| 'identify'
|
|
|
|
| 'guilds'
|
|
|
|
| 'guilds.join'
|
|
|
|
| 'gdm.join'
|
|
|
|
| 'webhook.incoming';
|
|
|
|
|
|
|
|
export interface LifetimeFilterOptions<K, V> {
|
|
|
|
excludeFromSweep?: (value: V, key: K, collection: LimitedCollection<K, V>) => boolean;
|
|
|
|
getComparisonTimestamp?: (value: V, key: K, collection: LimitedCollection<K, V>) => number;
|
|
|
|
lifetime?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MakeErrorOptions {
|
|
|
|
name: string;
|
|
|
|
message: string;
|
|
|
|
stack: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MemberMention = UserMention | `<@!${Snowflake}>`;
|
|
|
|
|
|
|
|
export type MembershipState = keyof typeof MembershipStates;
|
|
|
|
|
|
|
|
export type MessageActionRowComponent = MessageButton | MessageSelectMenu;
|
|
|
|
|
|
|
|
export type MessageActionRowComponentOptions =
|
|
|
|
| (Required<BaseMessageComponentOptions> & MessageButtonOptions)
|
|
|
|
| (Required<BaseMessageComponentOptions> & MessageSelectMenuOptions);
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type MessageActionRowComponentResolvable =
|
|
|
|
| MessageActionRowComponent
|
|
|
|
| MessageActionRowComponentOptions
|
|
|
|
| APIMessageActionRowComponent;
|
|
|
|
|
|
|
|
export type ModalActionRowComponent = TextInputComponent;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type ModalActionRowComponentOptions = TextInputComponentOptions;
|
|
|
|
|
|
|
|
export type ModalActionRowComponentResolvable =
|
|
|
|
| ModalActionRowComponent
|
|
|
|
| ModalActionRowComponentOptions
|
|
|
|
| APIModalActionRowComponent;
|
|
|
|
|
|
|
|
export interface MessageActionRowOptions<
|
|
|
|
T extends
|
|
|
|
| MessageActionRowComponentResolvable
|
|
|
|
| ModalActionRowComponentResolvable = MessageActionRowComponentResolvable,
|
|
|
|
> extends BaseMessageComponentOptions {
|
|
|
|
components: T[];
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageActivity {
|
|
|
|
partyId: string;
|
2022-07-09 05:31:42 +00:00
|
|
|
type: MessageActivityType;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface BaseButtonOptions extends BaseMessageComponentOptions {
|
|
|
|
disabled?: boolean;
|
|
|
|
emoji?: EmojiIdentifierResolvable;
|
|
|
|
label?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LinkButtonOptions extends BaseButtonOptions {
|
|
|
|
style: 'LINK' | MessageButtonStyles.LINK;
|
|
|
|
url: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface InteractionButtonOptions extends BaseButtonOptions {
|
|
|
|
style: ExcludeEnum<typeof MessageButtonStyles, 'LINK'>;
|
|
|
|
customId: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageButtonOptions = InteractionButtonOptions | LinkButtonOptions;
|
|
|
|
|
|
|
|
export type MessageButtonStyle = keyof typeof MessageButtonStyles;
|
|
|
|
|
|
|
|
export type MessageButtonStyleResolvable = MessageButtonStyle | MessageButtonStyles;
|
|
|
|
|
|
|
|
export interface MessageCollectorOptions extends CollectorOptions<[Message]> {
|
|
|
|
max?: number;
|
|
|
|
maxProcessed?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageComponent = BaseMessageComponent | MessageActionRow | MessageButton | MessageSelectMenu;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type MessageComponentCollectorOptions<T extends MessageComponentInteraction | ModalSubmitInteraction> = Omit<
|
2022-03-19 10:37:45 +00:00
|
|
|
InteractionCollectorOptions<T>,
|
|
|
|
'channel' | 'message' | 'guild' | 'interactionType'
|
|
|
|
>;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type MessageChannelComponentCollectorOptions<T extends MessageComponentInteraction | ModalSubmitInteraction> =
|
|
|
|
Omit<InteractionCollectorOptions<T>, 'channel' | 'guild' | 'interactionType'>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type MessageComponentOptions =
|
|
|
|
| BaseMessageComponentOptions
|
|
|
|
| MessageActionRowOptions
|
|
|
|
| MessageButtonOptions
|
|
|
|
| MessageSelectMenuOptions;
|
|
|
|
|
|
|
|
export type MessageComponentType = keyof typeof MessageComponentTypes;
|
|
|
|
|
|
|
|
export type MessageComponentTypeResolvable = MessageComponentType | MessageComponentTypes;
|
|
|
|
|
|
|
|
export interface MessageEditOptions {
|
|
|
|
attachments?: MessageAttachment[];
|
|
|
|
content?: string | null;
|
2022-10-03 12:25:39 +00:00
|
|
|
id?: Snowflake | number;
|
|
|
|
parentId?: Snowflake | number;
|
|
|
|
type?: ExcludeEnum<
|
|
|
|
typeof ChannelTypes,
|
|
|
|
| 'DM'
|
|
|
|
| 'GROUP_DM'
|
|
|
|
| 'GUILD_NEWS'
|
|
|
|
| 'GUILD_STORE'
|
|
|
|
| 'UNKNOWN'
|
|
|
|
| 'GUILD_NEWS_THREAD'
|
|
|
|
| 'GUILD_PUBLIC_THREAD'
|
|
|
|
| 'GUILD_PRIVATE_THREAD'
|
|
|
|
| 'GUILD_STAGE_VOICE'
|
|
|
|
>;
|
|
|
|
name: string;
|
|
|
|
topic?: string;
|
|
|
|
nsfw?: boolean;
|
|
|
|
bitrate?: number;
|
|
|
|
userLimit?: number;
|
|
|
|
rtcRegion?: string | null;
|
|
|
|
videoQualityMode?: VideoQualityMode;
|
|
|
|
permissionOverwrites?: PartialOverwriteData[];
|
|
|
|
rateLimitPerUser?: number;
|
|
|
|
availableTags?: GuildForumTagData[];
|
|
|
|
defaultReactionEmoji?: DefaultReactionEmoji;
|
|
|
|
defaultThreadRateLimitPerUser?: number;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEmbedAuthor {
|
|
|
|
name: string;
|
|
|
|
url?: string;
|
|
|
|
iconURL?: string;
|
|
|
|
proxyIconURL?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEmbedFooter {
|
|
|
|
text: string;
|
|
|
|
iconURL?: string;
|
|
|
|
proxyIconURL?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEmbedImage {
|
|
|
|
url: string;
|
|
|
|
proxyURL?: string;
|
|
|
|
height?: number;
|
|
|
|
width?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEmbedOptions {
|
|
|
|
title?: string;
|
|
|
|
description?: string;
|
|
|
|
url?: string;
|
|
|
|
timestamp?: Date | number;
|
|
|
|
color?: ColorResolvable;
|
|
|
|
fields?: EmbedFieldData[];
|
|
|
|
author?: Partial<MessageEmbedAuthor> & { icon_url?: string; proxy_icon_url?: string };
|
|
|
|
thumbnail?: Partial<MessageEmbedThumbnail> & { proxy_url?: string };
|
|
|
|
image?: Partial<MessageEmbedImage> & { proxy_url?: string };
|
|
|
|
video?: Partial<MessageEmbedVideo> & { proxy_url?: string };
|
|
|
|
footer?: Partial<MessageEmbedFooter> & { icon_url?: string; proxy_icon_url?: string };
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEmbedProvider {
|
|
|
|
name: string;
|
|
|
|
url: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEmbedThumbnail {
|
|
|
|
url: string;
|
|
|
|
proxyURL?: string;
|
|
|
|
height?: number;
|
|
|
|
width?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEmbedVideo {
|
|
|
|
url?: string;
|
|
|
|
proxyURL?: string;
|
|
|
|
height?: number;
|
|
|
|
width?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageEvent {
|
|
|
|
data: WebSocket.Data;
|
|
|
|
type: string;
|
|
|
|
target: WebSocket;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageFlagsString =
|
|
|
|
| 'CROSSPOSTED'
|
|
|
|
| 'IS_CROSSPOST'
|
|
|
|
| 'SUPPRESS_EMBEDS'
|
|
|
|
| 'SOURCE_MESSAGE_DELETED'
|
|
|
|
| 'URGENT'
|
|
|
|
| 'HAS_THREAD'
|
|
|
|
| 'EPHEMERAL'
|
2022-12-03 18:46:40 +00:00
|
|
|
| 'LOADING'
|
2023-03-02 15:11:21 +00:00
|
|
|
| 'FAILED_TO_MENTION_SOME_ROLES_IN_THREAD'
|
2023-04-25 11:18:55 +00:00
|
|
|
| 'SUPPRESS_NOTIFICATIONS'
|
|
|
|
| 'IS_VOICE_MESSAGE';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface MessageInteraction {
|
|
|
|
id: Snowflake;
|
|
|
|
type: InteractionType;
|
|
|
|
commandName: string;
|
|
|
|
user: User;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageMentionsHasOptions {
|
|
|
|
ignoreDirect?: boolean;
|
|
|
|
ignoreRoles?: boolean;
|
2022-05-14 08:06:15 +00:00
|
|
|
ignoreRepliedUser?: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
ignoreEveryone?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageMentionOptions {
|
|
|
|
parse?: MessageMentionTypes[];
|
|
|
|
roles?: Snowflake[];
|
|
|
|
users?: Snowflake[];
|
|
|
|
repliedUser?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageMentionTypes = 'roles' | 'users' | 'everyone';
|
|
|
|
|
|
|
|
export interface MessageOptions {
|
2022-07-07 09:10:51 +00:00
|
|
|
activity?: MessageActivity;
|
2022-03-19 10:37:45 +00:00
|
|
|
tts?: boolean;
|
|
|
|
nonce?: string | number;
|
|
|
|
content?: string | null;
|
2022-04-01 12:44:16 +00:00
|
|
|
embeds?: (WebEmbed | MessageEmbed | MessageEmbedOptions | APIEmbed)[];
|
2022-03-19 10:37:45 +00:00
|
|
|
components?: (MessageActionRow | (Required<BaseMessageComponentOptions> & MessageActionRowOptions))[];
|
|
|
|
allowedMentions?: MessageMentionOptions;
|
|
|
|
files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
|
|
|
reply?: ReplyOptions;
|
|
|
|
stickers?: StickerResolvable[];
|
|
|
|
attachments?: MessageAttachment[];
|
2023-03-02 15:11:21 +00:00
|
|
|
flags?: BitFieldResolvable<'SUPPRESS_EMBEDS' | 'SUPPRESS_NOTIFICATIONS', number>;
|
2022-11-27 12:45:58 +00:00
|
|
|
usingNewAttachmentAPI?: boolean;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
2023-01-06 10:39:46 +00:00
|
|
|
export type MessageReactionResolvable = MessageReaction | Snowflake | string;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface MessageReference {
|
|
|
|
channelId: Snowflake;
|
|
|
|
guildId: Snowflake | undefined;
|
|
|
|
messageId: Snowflake | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageResolvable = Message | Snowflake;
|
|
|
|
|
2022-12-18 06:17:48 +00:00
|
|
|
export interface BaseMessageSelectMenuOptions {
|
|
|
|
type?: SelectMenuComponentType | SelectMenuComponentTypes;
|
2022-03-19 10:37:45 +00:00
|
|
|
customId?: string;
|
|
|
|
disabled?: boolean;
|
|
|
|
maxValues?: number;
|
|
|
|
minValues?: number;
|
|
|
|
placeholder?: string;
|
|
|
|
}
|
2022-12-18 06:17:48 +00:00
|
|
|
export interface StringMessageSelectMenuOptions extends BaseMessageSelectMenuOptions {
|
2023-02-28 06:42:35 +00:00
|
|
|
type?:
|
|
|
|
| 'STRING_SELECT'
|
|
|
|
| 'SELECT_MENU'
|
|
|
|
| SelectMenuComponentTypes.STRING_SELECT
|
|
|
|
| SelectMenuComponentTypes.SELECT_MENU;
|
2022-12-18 06:17:48 +00:00
|
|
|
options?: MessageSelectOptionData[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ChannelMessageSelectMenuOptions extends BaseMessageSelectMenuOptions {
|
|
|
|
type?: 'CHANNEL_SELECT' | SelectMenuComponentTypes.CHANNEL_SELECT;
|
|
|
|
channelTypes?: ChannelTypes[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OtherMessageSelectMenuOptions extends BaseMessageSelectMenuOptions {
|
|
|
|
type?: ExcludeEnum<typeof SelectMenuComponentTypes, 'CHANNEL_SELECT' | 'STRING_SELECT'>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageSelectMenuOptions =
|
|
|
|
| StringMessageSelectMenuOptions
|
|
|
|
| ChannelMessageSelectMenuOptions
|
|
|
|
| OtherMessageSelectMenuOptions;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface MessageSelectOption {
|
|
|
|
default: boolean;
|
|
|
|
description: string | null;
|
|
|
|
emoji: APIPartialEmoji | null;
|
|
|
|
label: string;
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageSelectOptionData {
|
|
|
|
default?: boolean;
|
|
|
|
description?: string;
|
|
|
|
emoji?: EmojiIdentifierResolvable;
|
|
|
|
label: string;
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type MessageTarget =
|
|
|
|
| Interaction
|
|
|
|
| InteractionWebhook
|
|
|
|
| TextBasedChannel
|
|
|
|
| User
|
|
|
|
| GuildMember
|
|
|
|
| Webhook
|
|
|
|
| WebhookClient
|
|
|
|
| Message
|
|
|
|
| MessageManager;
|
|
|
|
|
|
|
|
export type MessageType = keyof typeof MessageTypes;
|
|
|
|
|
|
|
|
export type MFALevel = keyof typeof MFALevels;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface ModalOptions {
|
|
|
|
components:
|
|
|
|
| MessageActionRow<ModalActionRowComponent>[]
|
|
|
|
| MessageActionRowOptions<ModalActionRowComponentResolvable>[];
|
|
|
|
customId: string;
|
|
|
|
title: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ModalSubmitInteractionCollectorOptions<T extends ModalSubmitInteraction> = Omit<
|
|
|
|
InteractionCollectorOptions<T>,
|
|
|
|
'channel' | 'message' | 'guild' | 'interactionType'
|
|
|
|
>;
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface MultipleShardRespawnOptions {
|
|
|
|
shardDelay?: number;
|
|
|
|
respawnDelay?: number;
|
|
|
|
timeout?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MultipleShardSpawnOptions {
|
|
|
|
amount?: number | 'auto';
|
|
|
|
delay?: number;
|
|
|
|
timeout?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type NSFWLevel = keyof typeof NSFWLevels;
|
|
|
|
|
|
|
|
export interface OverwriteData {
|
|
|
|
allow?: PermissionResolvable;
|
|
|
|
deny?: PermissionResolvable;
|
|
|
|
id: GuildMemberResolvable | RoleResolvable;
|
|
|
|
type?: OverwriteType;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type OverwriteResolvable = PermissionOverwrites | OverwriteData;
|
|
|
|
|
|
|
|
export type OverwriteType = 'member' | 'role';
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface PartialModalActionRow {
|
|
|
|
type: MessageComponentType;
|
|
|
|
components: PartialTextInputData[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PartialTextInputData {
|
|
|
|
value: string;
|
|
|
|
// TODO: use dapi types
|
|
|
|
type: MessageComponentType;
|
|
|
|
customId: string;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export type PermissionFlags = Record<PermissionString, bigint>;
|
|
|
|
|
|
|
|
export type PermissionOverwriteOptions = Partial<Record<PermissionString, boolean | null>>;
|
|
|
|
|
|
|
|
export type PermissionResolvable = BitFieldResolvable<PermissionString, bigint>;
|
|
|
|
|
|
|
|
export type PermissionOverwriteResolvable = UserResolvable | RoleResolvable | PermissionOverwrites;
|
|
|
|
|
|
|
|
export type PermissionString =
|
|
|
|
| 'CREATE_INSTANT_INVITE'
|
|
|
|
| 'KICK_MEMBERS'
|
|
|
|
| 'BAN_MEMBERS'
|
|
|
|
| 'ADMINISTRATOR'
|
|
|
|
| 'MANAGE_CHANNELS'
|
|
|
|
| 'MANAGE_GUILD'
|
|
|
|
| 'ADD_REACTIONS'
|
|
|
|
| 'VIEW_AUDIT_LOG'
|
|
|
|
| 'PRIORITY_SPEAKER'
|
|
|
|
| 'STREAM'
|
|
|
|
| 'VIEW_CHANNEL'
|
|
|
|
| 'SEND_MESSAGES'
|
|
|
|
| 'SEND_TTS_MESSAGES'
|
|
|
|
| 'MANAGE_MESSAGES'
|
|
|
|
| 'EMBED_LINKS'
|
|
|
|
| 'ATTACH_FILES'
|
|
|
|
| 'READ_MESSAGE_HISTORY'
|
|
|
|
| 'MENTION_EVERYONE'
|
|
|
|
| 'USE_EXTERNAL_EMOJIS'
|
|
|
|
| 'VIEW_GUILD_INSIGHTS'
|
|
|
|
| 'CONNECT'
|
|
|
|
| 'SPEAK'
|
|
|
|
| 'MUTE_MEMBERS'
|
|
|
|
| 'DEAFEN_MEMBERS'
|
|
|
|
| 'MOVE_MEMBERS'
|
|
|
|
| 'USE_VAD'
|
|
|
|
| 'CHANGE_NICKNAME'
|
|
|
|
| 'MANAGE_NICKNAMES'
|
|
|
|
| 'MANAGE_ROLES'
|
|
|
|
| 'MANAGE_WEBHOOKS'
|
|
|
|
| 'MANAGE_EMOJIS_AND_STICKERS'
|
|
|
|
| 'USE_APPLICATION_COMMANDS'
|
|
|
|
| 'REQUEST_TO_SPEAK'
|
|
|
|
| 'MANAGE_THREADS'
|
|
|
|
| 'USE_PUBLIC_THREADS'
|
|
|
|
| 'CREATE_PUBLIC_THREADS'
|
|
|
|
| 'USE_PRIVATE_THREADS'
|
|
|
|
| 'CREATE_PRIVATE_THREADS'
|
|
|
|
| 'USE_EXTERNAL_STICKERS'
|
|
|
|
| 'SEND_MESSAGES_IN_THREADS'
|
|
|
|
| 'START_EMBEDDED_ACTIVITIES'
|
|
|
|
| 'MODERATE_MEMBERS'
|
2023-04-15 12:43:39 +00:00
|
|
|
| 'MANAGE_EVENTS'
|
|
|
|
| 'VIEW_CREATOR_MONETIZATION_ANALYTICS'
|
2023-04-25 11:18:55 +00:00
|
|
|
| 'USE_SOUNDBOARD'
|
|
|
|
| 'SEND_VOICE_MESSAGES';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type RecursiveArray<T> = ReadonlyArray<T | RecursiveArray<T>>;
|
|
|
|
|
|
|
|
export type RecursiveReadonlyArray<T> = ReadonlyArray<T | RecursiveReadonlyArray<T>>;
|
|
|
|
|
|
|
|
export type PremiumTier = keyof typeof PremiumTiers;
|
|
|
|
|
|
|
|
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?: ExcludeEnum<
|
|
|
|
typeof ChannelTypes,
|
|
|
|
| 'DM'
|
|
|
|
| 'GROUP_DM'
|
|
|
|
| 'GUILD_NEWS'
|
|
|
|
| 'GUILD_STORE'
|
|
|
|
| 'UNKNOWN'
|
|
|
|
| 'GUILD_NEWS_THREAD'
|
|
|
|
| 'GUILD_PUBLIC_THREAD'
|
|
|
|
| 'GUILD_PRIVATE_THREAD'
|
|
|
|
| 'GUILD_STAGE_VOICE'
|
|
|
|
>;
|
|
|
|
name: string;
|
|
|
|
topic?: string;
|
|
|
|
nsfw?: boolean;
|
|
|
|
bitrate?: number;
|
|
|
|
userLimit?: number;
|
|
|
|
rtcRegion?: string | null;
|
2022-05-14 08:06:15 +00:00
|
|
|
videoQualityMode?: VideoQualityMode;
|
2022-03-19 10:37:45 +00:00
|
|
|
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 | '' = '',
|
2022-04-16 10:44:43 +00:00
|
|
|
> = {
|
|
|
|
readonly client: Client;
|
|
|
|
id: Snowflake;
|
|
|
|
partial: true;
|
|
|
|
} & {
|
|
|
|
[K in keyof Omit<T, 'client' | 'id' | 'partial' | E>]: K extends N ? null : K extends M ? T[K] | null : T[K];
|
|
|
|
};
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface PartialDMChannel extends Partialize<DMChannel, null, null, 'lastMessageId'> {
|
|
|
|
lastMessageId: undefined;
|
|
|
|
}
|
|
|
|
|
2022-04-16 10:44:43 +00:00
|
|
|
export interface PartialGuildMember extends Partialize<GuildMember, 'joinedAt' | 'joinedTimestamp'> {}
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface PartialMessage
|
2022-04-16 10:44:43 +00:00
|
|
|
extends Partialize<Message, 'type' | 'system' | 'pinned' | 'tts', 'content' | 'cleanContent' | 'author'> {}
|
2022-03-19 10:37:45 +00:00
|
|
|
|
2022-04-16 10:44:43 +00:00
|
|
|
export interface PartialMessageReaction extends Partialize<MessageReaction, 'count'> {}
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export interface PartialOverwriteData {
|
|
|
|
id: Snowflake | number;
|
|
|
|
type?: OverwriteType;
|
|
|
|
allow?: PermissionResolvable;
|
|
|
|
deny?: PermissionResolvable;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PartialRoleData extends RoleData {
|
|
|
|
id?: Snowflake | number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type PartialTypes = 'USER' | 'CHANNEL' | 'GUILD_MEMBER' | 'MESSAGE' | 'REACTION' | 'GUILD_SCHEDULED_EVENT';
|
|
|
|
|
2022-04-16 10:44:43 +00:00
|
|
|
export interface PartialUser extends Partialize<User, 'username' | 'tag' | 'discriminator'> {}
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type PresenceStatusData = ClientPresenceStatus | 'invisible';
|
|
|
|
|
|
|
|
export type PresenceStatus = PresenceStatusData | 'offline';
|
|
|
|
|
|
|
|
export type PrivacyLevel = keyof typeof PrivacyLevels;
|
|
|
|
|
|
|
|
export interface RateLimitData {
|
|
|
|
timeout: number;
|
|
|
|
limit: number;
|
|
|
|
method: string;
|
|
|
|
path: string;
|
|
|
|
route: string;
|
|
|
|
global: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface InvalidRequestWarningData {
|
|
|
|
count: number;
|
|
|
|
remainingTime: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ReactionCollectorOptions extends CollectorOptions<[MessageReaction, User]> {
|
|
|
|
max?: number;
|
|
|
|
maxEmojis?: number;
|
|
|
|
maxUsers?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ReplyOptions {
|
|
|
|
messageReference: MessageResolvable;
|
|
|
|
failIfNotExists?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ReplyMessageOptions extends Omit<MessageOptions, 'reply'> {
|
|
|
|
failIfNotExists?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ResolvedOverwriteOptions {
|
|
|
|
allow: Permissions;
|
|
|
|
deny: Permissions;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 RoleTagData {
|
|
|
|
botId?: Snowflake;
|
|
|
|
integrationId?: Snowflake;
|
|
|
|
premiumSubscriberRole?: true;
|
2023-01-26 06:48:53 +00:00
|
|
|
subscriptionListingId?: Snowflake;
|
|
|
|
availableForPurchase?: true;
|
2023-04-20 11:23:22 +00:00
|
|
|
guildConnections?: true;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
shardArgs?: string[];
|
|
|
|
token?: string;
|
|
|
|
execArgv?: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export { Snowflake };
|
|
|
|
|
|
|
|
export interface SplitOptions {
|
|
|
|
maxLength?: number;
|
|
|
|
char?: string | string[] | RegExp | RegExp[];
|
|
|
|
prepend?: string;
|
|
|
|
append?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface StaticImageURLOptions {
|
|
|
|
format?: AllowedImageFormat;
|
|
|
|
size?: AllowedImageSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type StageInstanceResolvable = StageInstance | Snowflake;
|
|
|
|
|
|
|
|
export interface StartThreadOptions {
|
|
|
|
name: string;
|
2022-05-14 08:06:15 +00:00
|
|
|
autoArchiveDuration?: ThreadAutoArchiveDuration | 'MAX';
|
2022-03-19 10:37:45 +00:00
|
|
|
reason?: string;
|
|
|
|
rateLimitPerUser?: number;
|
|
|
|
}
|
|
|
|
|
2022-12-02 11:29:57 +00:00
|
|
|
export interface MessageButtonLocation {
|
|
|
|
row: number;
|
2022-12-03 18:13:19 +00:00
|
|
|
col: number;
|
2022-12-02 11:29:57 +00:00
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export type Status = number;
|
|
|
|
|
|
|
|
export type StickerFormatType = keyof typeof StickerFormatTypes;
|
|
|
|
|
|
|
|
export type StickerResolvable = Sticker | Snowflake;
|
|
|
|
|
|
|
|
export type StickerType = keyof typeof StickerTypes;
|
|
|
|
|
|
|
|
export type SystemChannelFlagsString =
|
|
|
|
| 'SUPPRESS_JOIN_NOTIFICATIONS'
|
|
|
|
| 'SUPPRESS_PREMIUM_SUBSCRIPTIONS'
|
|
|
|
| 'SUPPRESS_GUILD_REMINDER_NOTIFICATIONS'
|
2023-04-29 12:20:14 +00:00
|
|
|
| 'SUPPRESS_JOIN_NOTIFICATION_REPLIES'
|
|
|
|
| 'SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS'
|
|
|
|
| 'SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type SystemChannelFlagsResolvable = BitFieldResolvable<SystemChannelFlagsString, number>;
|
|
|
|
|
|
|
|
export type SystemMessageType = Exclude<
|
|
|
|
MessageType,
|
|
|
|
'DEFAULT' | 'REPLY' | 'APPLICATION_COMMAND' | 'CONTEXT_MENU_COMMAND'
|
|
|
|
>;
|
|
|
|
|
|
|
|
export type StageChannelResolvable = StageChannel | Snowflake;
|
|
|
|
|
|
|
|
export interface StageInstanceEditOptions {
|
|
|
|
topic?: string;
|
|
|
|
privacyLevel?: PrivacyLevel | number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SweeperKey = keyof SweeperDefinitions;
|
|
|
|
|
|
|
|
export type CollectionSweepFilter<K, V> = (value: V, key: K, collection: Collection<K, V>) => boolean;
|
|
|
|
|
|
|
|
export type SweepFilter<K, V> = (
|
|
|
|
collection: LimitedCollection<K, V>,
|
|
|
|
) => ((value: V, key: K, collection: LimitedCollection<K, V>) => boolean) | null;
|
|
|
|
|
|
|
|
export interface SweepOptions<K, V> {
|
|
|
|
interval: number;
|
|
|
|
filter: GlobalSweepFilter<K, V>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LifetimeSweepOptions {
|
|
|
|
interval: number;
|
|
|
|
lifetime: number;
|
|
|
|
filter?: never;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SweeperDefinitions {
|
|
|
|
applicationCommands: [Snowflake, ApplicationCommand];
|
2022-12-20 15:46:50 +00:00
|
|
|
autoModerationRules: [Snowflake, AutoModerationRule];
|
2022-03-19 10:37:45 +00:00
|
|
|
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, ThreadChannel, true];
|
|
|
|
users: [Snowflake, User];
|
|
|
|
voiceStates: [Snowflake, VoiceState];
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SweeperOptions = {
|
|
|
|
[K in keyof SweeperDefinitions]?: SweeperDefinitions[K][2] extends true
|
2022-04-16 10:44:43 +00:00
|
|
|
? SweepOptions<SweeperDefinitions[K][0], SweeperDefinitions[K][1]> | LifetimeSweepOptions
|
|
|
|
: SweepOptions<SweeperDefinitions[K][0], SweeperDefinitions[K][1]>;
|
2022-03-19 10:37:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export interface LimitedCollectionOptions<K, V> {
|
|
|
|
maxSize?: number;
|
|
|
|
keepOverLimit?: (value: V, key: K, collection: LimitedCollection<K, V>) => boolean;
|
|
|
|
/** @deprecated Use Global Sweepers instead */
|
|
|
|
sweepFilter?: SweepFilter<K, V>;
|
|
|
|
/** @deprecated Use Global Sweepers instead */
|
|
|
|
sweepInterval?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type AnyChannel =
|
|
|
|
| CategoryChannel
|
|
|
|
| DMChannel
|
|
|
|
| PartialDMChannel
|
|
|
|
| NewsChannel
|
|
|
|
| StageChannel
|
|
|
|
| StoreChannel
|
|
|
|
| TextChannel
|
|
|
|
| ThreadChannel
|
2022-10-03 12:25:39 +00:00
|
|
|
| VoiceChannel
|
2023-03-05 10:05:40 +00:00
|
|
|
| ForumChannel
|
|
|
|
| PartialGroupDMChannel;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
2022-10-09 12:45:45 +00:00
|
|
|
export type TextBasedChannel = Exclude<
|
|
|
|
Extract<AnyChannel, { messages: MessageManager; interactions: InteractionManager }>,
|
|
|
|
ForumChannel
|
|
|
|
>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type TextBasedChannelTypes = TextBasedChannel['type'];
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export interface TextInputComponentOptions extends BaseMessageComponentOptions {
|
|
|
|
customId?: string;
|
|
|
|
label?: string;
|
|
|
|
minLength?: number;
|
|
|
|
maxLength?: number;
|
|
|
|
placeholder?: string;
|
|
|
|
required?: boolean;
|
|
|
|
style?: TextInputStyleResolvable;
|
|
|
|
value?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TextInputStyle = keyof typeof TextInputStyles;
|
|
|
|
|
|
|
|
export type TextInputStyleResolvable = TextInputStyle | TextInputStyles;
|
|
|
|
export interface IntegrationAccount {
|
|
|
|
id: string | Snowflake;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export type VoiceBasedChannel = Extract<AnyChannel, { bitrate: number }>;
|
|
|
|
|
|
|
|
export type GuildBasedChannel = Extract<AnyChannel, { guild: Guild }>;
|
|
|
|
|
|
|
|
export type NonThreadGuildBasedChannel = Exclude<GuildBasedChannel, ThreadChannel>;
|
|
|
|
|
2022-10-03 12:25:39 +00:00
|
|
|
export type GuildTextBasedChannel = Exclude<Extract<GuildBasedChannel, TextBasedChannel>, ForumChannel>;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type TextChannelResolvable = Snowflake | TextChannel;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type TextBasedChannelResolvable = Snowflake | TextBasedChannel;
|
|
|
|
|
|
|
|
export type ThreadAutoArchiveDuration = 60 | 1440 | 4320 | 10080;
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type ThreadChannelResolvable = ThreadChannel | Snowflake;
|
|
|
|
|
|
|
|
export type ThreadChannelTypes = 'GUILD_NEWS_THREAD' | 'GUILD_PUBLIC_THREAD' | 'GUILD_PRIVATE_THREAD';
|
|
|
|
|
2022-10-03 12:25:39 +00:00
|
|
|
export interface GuildTextThreadCreateOptions<AllowedThreadType> extends StartThreadOptions {
|
2022-03-19 10:37:45 +00:00
|
|
|
startMessage?: MessageResolvable;
|
|
|
|
type?: AllowedThreadType;
|
|
|
|
invitable?: AllowedThreadType extends 'GUILD_PRIVATE_THREAD' | 12 ? boolean : never;
|
|
|
|
rateLimitPerUser?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ThreadEditData {
|
|
|
|
name?: string;
|
|
|
|
archived?: boolean;
|
2022-05-14 08:06:15 +00:00
|
|
|
autoArchiveDuration?: ThreadAutoArchiveDuration | 'MAX';
|
2022-03-19 10:37:45 +00:00
|
|
|
rateLimitPerUser?: number;
|
|
|
|
locked?: boolean;
|
|
|
|
invitable?: boolean;
|
2023-01-08 07:32:25 +00:00
|
|
|
appliedTags?: Snowflake[];
|
2022-10-26 12:38:09 +00:00
|
|
|
flags?: ChannelFlagsResolvable;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type ThreadMemberFlagsString = '';
|
|
|
|
|
|
|
|
export type ThreadMemberResolvable = ThreadMember | UserResolvable;
|
|
|
|
|
|
|
|
export type UserFlagsString =
|
|
|
|
| 'DISCORD_EMPLOYEE'
|
|
|
|
| 'PARTNERED_SERVER_OWNER'
|
|
|
|
| 'HYPESQUAD_EVENTS'
|
|
|
|
| 'BUGHUNTER_LEVEL_1'
|
2023-04-22 06:00:50 +00:00
|
|
|
| 'MFA_SMS'
|
|
|
|
| 'PREMIUM_PROMO_DISMISSED'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'HOUSE_BRAVERY'
|
|
|
|
| 'HOUSE_BRILLIANCE'
|
|
|
|
| 'HOUSE_BALANCE'
|
|
|
|
| 'EARLY_SUPPORTER'
|
|
|
|
| 'TEAM_USER'
|
2023-04-22 06:00:50 +00:00
|
|
|
| 'INTERNAL_APPLICATION'
|
|
|
|
| 'SYSTEM'
|
|
|
|
| 'HAS_UNREAD_URGENT_MESSAGES'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'BUGHUNTER_LEVEL_2'
|
2023-04-22 06:00:50 +00:00
|
|
|
| 'UNDERAGE_DELETED'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'VERIFIED_BOT'
|
|
|
|
| 'EARLY_VERIFIED_BOT_DEVELOPER'
|
|
|
|
| 'DISCORD_CERTIFIED_MODERATOR'
|
2023-04-22 06:00:50 +00:00
|
|
|
| 'BOT_HTTP_INTERACTIONS'
|
|
|
|
| 'SPAMMER'
|
|
|
|
| 'DISABLE_PREMIUM'
|
|
|
|
| 'ACTIVE_DEVELOPER'
|
|
|
|
| 'HIGH_GLOBAL_RATE_LIMIT'
|
|
|
|
| 'DELETED'
|
|
|
|
| 'DISABLED_SUSPICIOUS_ACTIVITY'
|
|
|
|
| 'SELF_DELETED'
|
|
|
|
| 'PREMIUM_DISCRIMINATOR'
|
|
|
|
| 'USED_DESKTOP_CLIENT'
|
|
|
|
| 'USED_WEB_CLIENT'
|
|
|
|
| 'USED_MOBILE_CLIENT'
|
|
|
|
| 'DISABLED'
|
|
|
|
| 'VERIFIED_EMAIL'
|
|
|
|
| 'QUARANTINED'
|
|
|
|
| 'COLLABORATOR'
|
|
|
|
| 'RESTRICTED_COLLABORATOR';
|
2022-03-19 10:37:45 +00:00
|
|
|
|
|
|
|
export type UserMention = `<@${Snowflake}>`;
|
|
|
|
|
|
|
|
export type UserResolvable = User | Snowflake | Message | GuildMember | ThreadMember;
|
|
|
|
|
|
|
|
export interface Vanity {
|
|
|
|
code: string | null;
|
|
|
|
uses: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type VerificationLevel = keyof typeof VerificationLevels;
|
|
|
|
|
2022-05-14 08:06:15 +00:00
|
|
|
export type VideoQualityMode = keyof typeof VideoQualityModes;
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export type VoiceBasedChannelTypes = VoiceBasedChannel['type'];
|
|
|
|
|
|
|
|
export type VoiceChannelResolvable = Snowflake | VoiceChannel;
|
|
|
|
|
|
|
|
export type WebhookClientData = WebhookClientDataIdWithToken | WebhookClientDataURL;
|
|
|
|
|
|
|
|
export interface WebhookClientDataIdWithToken {
|
|
|
|
id: Snowflake;
|
|
|
|
token: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WebhookClientDataURL {
|
|
|
|
url: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type WebhookClientOptions = Pick<
|
|
|
|
ClientOptions,
|
|
|
|
'allowedMentions' | 'restTimeOffset' | 'restRequestTimeout' | 'retryLimit' | 'http'
|
|
|
|
>;
|
|
|
|
|
|
|
|
export interface WebhookEditData {
|
|
|
|
name?: string;
|
|
|
|
avatar?: BufferResolvable | null;
|
2023-04-15 12:53:43 +00:00
|
|
|
channel?: GuildTextChannelResolvable | VoiceChannel | StageChannel | ForumChannel;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type WebhookEditMessageOptions = Pick<
|
|
|
|
WebhookMessageOptions,
|
|
|
|
'content' | 'embeds' | 'files' | 'allowedMentions' | 'components' | 'attachments' | 'threadId'
|
|
|
|
>;
|
|
|
|
|
2022-11-26 15:02:34 +00:00
|
|
|
export interface InteractionEditReplyOptions extends WebhookEditMessageOptions {
|
|
|
|
message?: MessageResolvable | '@original';
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
export interface WebhookFetchMessageOptions {
|
|
|
|
cache?: boolean;
|
|
|
|
threadId?: Snowflake;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WebhookMessageOptions extends Omit<MessageOptions, 'reply' | 'stickers'> {
|
|
|
|
username?: string;
|
|
|
|
avatarURL?: string;
|
|
|
|
threadId?: Snowflake;
|
2023-02-05 08:05:37 +00:00
|
|
|
threadName?: string;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type WebhookType = keyof typeof WebhookTypes;
|
|
|
|
|
|
|
|
export interface WebSocketOptions {
|
|
|
|
compress?: boolean;
|
|
|
|
properties?: WebSocketProperties;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WebSocketProperties {
|
2022-06-16 13:20:15 +00:00
|
|
|
os?: string;
|
|
|
|
browser?: string;
|
|
|
|
device?: string;
|
2022-06-17 05:41:55 +00:00
|
|
|
/** @deprecated Use {@link os} instead. */
|
|
|
|
$os?: string;
|
|
|
|
/** @deprecated Use {@link browser} instead. */
|
|
|
|
$browser?: string;
|
|
|
|
/** @deprecated Use {@link device} instead. */
|
|
|
|
$device?: string;
|
2022-03-19 10:37:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface WidgetActivity {
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WidgetChannel {
|
|
|
|
id: Snowflake;
|
|
|
|
name: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WelcomeChannelData {
|
|
|
|
description: string;
|
2022-10-03 12:25:39 +00:00
|
|
|
channel: TextChannel | NewsChannel | StoreChannel | ForumChannel | Snowflake;
|
2022-03-19 10:37:45 +00:00
|
|
|
emoji?: EmojiIdentifierResolvable;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WelcomeScreenEditData {
|
|
|
|
enabled?: boolean;
|
|
|
|
description?: string;
|
|
|
|
welcomeChannels?: WelcomeChannelData[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export type WSEventType =
|
|
|
|
| 'READY'
|
|
|
|
| 'RESUMED'
|
2022-07-12 12:30:18 +00:00
|
|
|
| 'APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'APPLICATION_COMMAND_CREATE'
|
|
|
|
| 'APPLICATION_COMMAND_DELETE'
|
|
|
|
| 'APPLICATION_COMMAND_UPDATE'
|
2023-02-19 05:01:37 +00:00
|
|
|
| 'APPLICATION_COMMAND_PERMISSIONS_UPDATE'
|
2023-02-12 10:43:14 +00:00
|
|
|
| 'AUTO_MODERATION_ACTION_EXECUTION'
|
|
|
|
| 'AUTO_MODERATION_RULE_CREATE'
|
|
|
|
| 'AUTO_MODERATION_RULE_DELETE'
|
|
|
|
| 'AUTO_MODERATION_RULE_UPDATE'
|
2022-03-19 10:37:45 +00:00
|
|
|
| 'GUILD_CREATE'
|
|
|
|
| 'GUILD_DELETE'
|
|
|
|
| 'GUILD_UPDATE'
|
|
|
|
| 'INVITE_CREATE'
|
|
|
|
| 'INVITE_DELETE'
|
|
|
|
| 'GUILD_MEMBER_ADD'
|
|
|
|
| 'GUILD_MEMBER_REMOVE'
|
|
|
|
| 'GUILD_MEMBER_UPDATE'
|
|
|
|
| 'GUILD_MEMBERS_CHUNK'
|
|
|
|
| 'GUILD_ROLE_CREATE'
|
|
|
|
| 'GUILD_ROLE_DELETE'
|
|
|
|
| 'GUILD_ROLE_UPDATE'
|
|
|
|
| 'GUILD_BAN_ADD'
|
|
|
|
| 'GUILD_BAN_REMOVE'
|
|
|
|
| 'GUILD_EMOJIS_UPDATE'
|
|
|
|
| 'GUILD_INTEGRATIONS_UPDATE'
|
|
|
|
| 'CHANNEL_CREATE'
|
|
|
|
| 'CHANNEL_DELETE'
|
|
|
|
| 'CHANNEL_UPDATE'
|
|
|
|
| 'CHANNEL_PINS_UPDATE'
|
|
|
|
| 'MESSAGE_CREATE'
|
|
|
|
| 'MESSAGE_DELETE'
|
|
|
|
| 'MESSAGE_UPDATE'
|
|
|
|
| 'MESSAGE_DELETE_BULK'
|
|
|
|
| 'MESSAGE_REACTION_ADD'
|
|
|
|
| 'MESSAGE_REACTION_REMOVE'
|
|
|
|
| 'MESSAGE_REACTION_REMOVE_ALL'
|
|
|
|
| 'MESSAGE_REACTION_REMOVE_EMOJI'
|
|
|
|
| 'THREAD_CREATE'
|
|
|
|
| 'THREAD_UPDATE'
|
|
|
|
| 'THREAD_DELETE'
|
|
|
|
| 'THREAD_LIST_SYNC'
|
|
|
|
| 'THREAD_MEMBER_UPDATE'
|
|
|
|
| 'THREAD_MEMBERS_UPDATE'
|
|
|
|
| 'USER_UPDATE'
|
|
|
|
| 'PRESENCE_UPDATE'
|
|
|
|
| 'TYPING_START'
|
|
|
|
| 'VOICE_STATE_UPDATE'
|
|
|
|
| 'VOICE_SERVER_UPDATE'
|
|
|
|
| 'WEBHOOKS_UPDATE'
|
|
|
|
| 'INTERACTION_CREATE'
|
|
|
|
| 'STAGE_INSTANCE_CREATE'
|
|
|
|
| 'STAGE_INSTANCE_UPDATE'
|
|
|
|
| 'STAGE_INSTANCE_DELETE'
|
|
|
|
| 'GUILD_STICKERS_UPDATE';
|
|
|
|
|
|
|
|
export type Serialized<T> = T extends symbol | bigint | (() => any)
|
|
|
|
? never
|
|
|
|
: T extends number | string | boolean | undefined
|
|
|
|
? T
|
|
|
|
: T extends { toJSON(): infer R }
|
|
|
|
? R
|
|
|
|
: T extends ReadonlyArray<infer V>
|
|
|
|
? Serialized<V>[]
|
|
|
|
: T extends ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
|
|
|
|
? {}
|
|
|
|
: { [K in keyof T]: Serialized<T[K]> };
|
|
|
|
|
|
|
|
//#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;
|
|
|
|
|
2022-10-03 12:25:39 +00:00
|
|
|
// GuildForum
|
2022-10-03 12:30:49 +00:00
|
|
|
export type ChannelFlagsString = 'PINNED' | 'REQUIRE_TAG';
|
2022-10-03 12:25:39 +00:00
|
|
|
export class ChannelFlags extends BitField<ChannelFlagsString> {
|
|
|
|
public static FLAGS: Record<ChannelFlagsString, number>;
|
|
|
|
public static resolve(bit?: BitFieldResolvable<ChannelFlagsString, number>): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
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<GuildForumTag> & { name: string };
|
|
|
|
|
|
|
|
export interface DefaultReactionEmoji {
|
|
|
|
id: Snowflake | null;
|
|
|
|
name: string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ForumChannel extends TextBasedChannelMixin(GuildChannel, [
|
|
|
|
'send',
|
|
|
|
'lastMessage',
|
|
|
|
'lastPinAt',
|
|
|
|
'bulkDelete',
|
|
|
|
'sendTyping',
|
|
|
|
'createMessageCollector',
|
|
|
|
'awaitMessages',
|
|
|
|
'createMessageComponentCollector',
|
|
|
|
'awaitMessageComponent',
|
|
|
|
]) {
|
|
|
|
public type: 'GUILD_FORUM';
|
|
|
|
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;
|
2022-12-25 03:35:06 +00:00
|
|
|
public defaultSortOrder: SortOrderType | null;
|
|
|
|
public defaultForumLayout: ForumLayoutType;
|
2022-10-03 12:25:39 +00:00
|
|
|
public setAvailableTags(tags: GuildForumTagData[], reason?: string): Promise<this>;
|
|
|
|
public setDefaultReactionEmoji(emojiId: DefaultReactionEmoji | null, reason?: string): Promise<this>;
|
|
|
|
public setDefaultThreadRateLimitPerUser(rateLimit: number, reason?: string): Promise<this>;
|
|
|
|
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
|
|
|
|
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
|
|
|
|
public setDefaultAutoArchiveDuration(
|
|
|
|
defaultAutoArchiveDuration: ThreadAutoArchiveDuration,
|
|
|
|
reason?: string,
|
|
|
|
): Promise<this>;
|
|
|
|
public setTopic(topic: string | null, reason?: string): Promise<this>;
|
|
|
|
public setDefaultSortOrder(defaultSortOrder: SortOrderType | null, reason?: string): Promise<this>;
|
2022-12-25 03:35:06 +00:00
|
|
|
public setDefaultForumLayout(defaultForumLayout: ForumLayoutType, reason?: string): Promise<this>;
|
2022-10-03 12:25:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildTextThreadManager<AllowedThreadType> extends ThreadManager {
|
|
|
|
public create(options: GuildTextThreadCreateOptions<AllowedThreadType>): Promise<ThreadChannel>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GuildForumThreadManager extends ThreadManager {
|
|
|
|
public create(options: GuildForumThreadCreateOptions): Promise<ThreadChannel>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GuildForumThreadMessageCreateOptions = MessageOptions & Pick<MessageOptions, 'flags' | 'stickers'>;
|
|
|
|
|
|
|
|
export type ChannelFlagsResolvable = BitFieldResolvable<ChannelFlagsString, number>;
|
|
|
|
|
2023-02-28 06:42:35 +00:00
|
|
|
export type SelectMenuComponentType = keyof typeof SelectMenuComponentTypes;
|
|
|
|
|
2022-10-03 12:25:39 +00:00
|
|
|
export interface GuildForumThreadCreateOptions extends StartThreadOptions {
|
|
|
|
message: GuildForumThreadMessageCreateOptions | MessagePayload;
|
|
|
|
appliedTags?: Snowflake[];
|
|
|
|
}
|
|
|
|
|
2022-03-19 10:37:45 +00:00
|
|
|
//#endregion
|