Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new APIErrors #5794

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/util/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
40 changes: 31 additions & 9 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1655,8 +1655,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>;
Expand All @@ -1679,8 +1685,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>;
Expand Down Expand Up @@ -1948,9 +1960,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 {
Expand Down Expand Up @@ -2127,8 +2137,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 {
Expand Down Expand Up @@ -2406,6 +2426,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;
Expand Down