types: change remaining string IDs to Snowflakes (#5737)

This commit is contained in:
Rodry
2021-06-03 19:17:31 +01:00
committed by GitHub
parent 3e9ce35023
commit ff4d6dded5

14
typings/index.d.ts vendored
View File

@@ -438,7 +438,7 @@ declare module 'discord.js' {
export class CommandInteraction extends Interaction {
public readonly command: ApplicationCommand | null;
public channel: TextChannel | DMChannel | NewsChannel;
public commandID: string;
public commandID: Snowflake;
public commandName: string;
public deferred: boolean;
public options: Collection<string, CommandInteractionOption>;
@@ -1760,7 +1760,7 @@ declare module 'discord.js' {
public static removeMentions(str: string): string;
public static cloneObject(obj: unknown): unknown;
public static delayFor(ms: number): Promise<void>;
public static discordSort<K, V extends { rawPosition: number; id: string }>(
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;
@@ -1779,7 +1779,7 @@ declare module 'discord.js' {
public static makePlainError(err: Error): { name: string; message: string; stack: string };
public static mergeDefault(def: unknown, given: unknown): unknown;
public static moveElementInArray(array: any[], element: any, newIndex: number, offset?: boolean): number;
public static parseEmoji(text: string): { animated: boolean; name: string; id: string | null } | null;
public static parseEmoji(text: string): { animated: boolean; name: string; id: Snowflake | null } | null;
public static resolveColor(color: ColorResolvable): number;
public static verifyString(data: string, error?: typeof Error, errorMessage?: string, allowEmpty?: boolean): string;
public static setPosition<T extends Channel | Role>(
@@ -1960,7 +1960,7 @@ declare module 'discord.js' {
}
export class WebhookClient extends WebhookMixin(BaseClient) {
constructor(id: string, token: string, options?: WebhookClientOptions);
constructor(id: Snowflake, token: string, options?: WebhookClientOptions);
public client: this;
public options: WebhookClientOptions;
public token: string;
@@ -3114,7 +3114,7 @@ declare module 'discord.js' {
}
interface IntegrationData {
id: string;
id: Snowflake;
type: string;
}
@@ -3124,7 +3124,7 @@ declare module 'discord.js' {
}
interface IntegrationAccount {
id: string;
id: string | Snowflake;
name: string;
}
@@ -3435,7 +3435,7 @@ declare module 'discord.js' {
readonly createdAt: Date;
readonly createdTimestamp: number;
deleted: boolean;
id: string;
id: Snowflake;
partial: true;
fetch(): Promise<T>;
} & {