mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: add new APIErrors (#5794)
This commit is contained in:
@@ -622,6 +622,8 @@ exports.VerificationLevels = ['NONE', 'LOW', 'MEDIUM', 'HIGH', 'VERY_HIGH'];
|
||||
* * MAXIMUM_CHANNELS
|
||||
* * MAXIMUM_ATTACHMENTS
|
||||
* * MAXIMUM_INVITES
|
||||
* * MAXIMUM_ANIMATED_EMOJIS
|
||||
* * MAXIMUM_SERVER_MEMBERS
|
||||
* * GUILD_ALREADY_HAS_TEMPLATE
|
||||
* * UNAUTHORIZED
|
||||
* * ACCOUNT_VERIFICATION_REQUIRED
|
||||
@@ -691,6 +693,8 @@ exports.APIErrors = {
|
||||
MAXIMUM_CHANNELS: 30013,
|
||||
MAXIMUM_ATTACHMENTS: 30015,
|
||||
MAXIMUM_INVITES: 30016,
|
||||
MAXIMUM_ANIMATED_EMOJIS: 30018,
|
||||
MAXIMUM_SERVER_MEMBERS: 30019,
|
||||
GUILD_ALREADY_HAS_TEMPLATE: 30031,
|
||||
UNAUTHORIZED: 40001,
|
||||
ACCOUNT_VERIFICATION_REQUIRED: 40002,
|
||||
|
||||
40
typings/index.d.ts
vendored
40
typings/index.d.ts
vendored
@@ -1653,8 +1653,14 @@ declare module 'discord.js' {
|
||||
public readonly ids: number[];
|
||||
public mode: ShardingManagerMode;
|
||||
public parentPort: any | null;
|
||||
public broadcastEval<T, P>(fn: (client: Client, context: P) => T, { shard: undefined, context: P }?: BroadcastEvalOptions): Promise<T[]>;
|
||||
public broadcastEval<T, P>(fn: (client: Client, context: P) => T, { shard: number, context: P }: BroadcastEvalOptions): Promise<T>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: undefined, context: P }?: BroadcastEvalOptions,
|
||||
): Promise<T[]>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: number, context: P }: BroadcastEvalOptions,
|
||||
): Promise<T>;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||
public respawnAll(options?: { shardDelay?: number; respawnDelay?: number; timeout?: number }): Promise<void>;
|
||||
@@ -1677,8 +1683,14 @@ declare module 'discord.js' {
|
||||
public totalShards: number | 'auto';
|
||||
public shardList: number[] | 'auto';
|
||||
public broadcast(message: any): Promise<Shard[]>;
|
||||
public broadcastEval<T, P>(fn: (client: Client, context: P) => T, { shard: undefined, context: P }?: BroadcastEvalOptions): Promise<T[]>;
|
||||
public broadcastEval<T, P>(fn: (client: Client, context: P) => T, { shard: number, context: P }: BroadcastEvalOptions): Promise<T>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: undefined, context: P }?: BroadcastEvalOptions,
|
||||
): Promise<T[]>;
|
||||
public broadcastEval<T, P>(
|
||||
fn: (client: Client, context: P) => T,
|
||||
{ shard: number, context: P }: BroadcastEvalOptions,
|
||||
): Promise<T>;
|
||||
public createShard(id: number): Shard;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||
@@ -1946,9 +1958,7 @@ declare module 'discord.js' {
|
||||
): Promise<RawMessage>;
|
||||
public fetchMessage(message: Snowflake, cache?: boolean): Promise<RawMessage>;
|
||||
public send(options: string | APIMessage | (WebhookMessageOptions & { split?: false })): Promise<RawMessage>;
|
||||
public send(
|
||||
options: APIMessage | (WebhookMessageOptions & { split: true | SplitOptions }),
|
||||
): Promise<RawMessage[]>;
|
||||
public send(options: APIMessage | (WebhookMessageOptions & { split: true | SplitOptions })): Promise<RawMessage[]>;
|
||||
}
|
||||
|
||||
export class WebSocketManager extends EventEmitter {
|
||||
@@ -2125,8 +2135,18 @@ declare module 'discord.js' {
|
||||
name: string,
|
||||
options: GuildCreateChannelOptions,
|
||||
): Promise<TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel | StageChannel>;
|
||||
public fetch(id: Snowflake, cache?: boolean, force?: boolean): Promise<TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel | StageChannel | null>;
|
||||
public fetch(id?: Snowflake, cache?: boolean, force?: boolean): Promise<Collection<Snowflake, TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel | StageChannel>>;
|
||||
public fetch(
|
||||
id: Snowflake,
|
||||
cache?: boolean,
|
||||
force?: boolean,
|
||||
): Promise<TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel | StageChannel | null>;
|
||||
public fetch(
|
||||
id?: Snowflake,
|
||||
cache?: boolean,
|
||||
force?: boolean,
|
||||
): Promise<
|
||||
Collection<Snowflake, TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel | StageChannel>
|
||||
>;
|
||||
}
|
||||
|
||||
export class GuildEmojiManager extends BaseGuildEmojiManager {
|
||||
@@ -2404,6 +2424,8 @@ declare module 'discord.js' {
|
||||
MAXIMUM_CHANNELS: 30013;
|
||||
MAXIMUM_ATTACHMENTS: 30015;
|
||||
MAXIMUM_INVITES: 30016;
|
||||
MAXIMUM_ANIMATED_EMOJIS: 30018;
|
||||
MAXIMUM_SERVER_MEMBERS: 30019;
|
||||
GUILD_ALREADY_HAS_TEMPLATE: 30031;
|
||||
UNAUTHORIZED: 40001;
|
||||
ACCOUNT_VERIFICATION_REQUIRED: 40002;
|
||||
|
||||
Reference in New Issue
Block a user