From 742bba2076c2afcd8021664356f6e0f38aa8b115 Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 30 Nov 2020 13:42:45 +0000 Subject: [PATCH 1/4] Remove duplicate interface --- index.d.ts | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/index.d.ts b/index.d.ts index 0306731c9..93e236f28 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1696,35 +1696,6 @@ declare namespace Eris { removeRecipient(userID: string): Promise; } - interface DiscoveryMetadata { - guild_id: string; - primary_category_id: number; - keywords: string[] | null; - emoji_discoverability_enabled: boolean; - category_ids: number[]; - } - - interface DiscoveryOptions { - primaryCategoryID?: string; - keywords?: string[]; - emojiDiscoverabilityEnabled?: boolean; - reason?: string; - } - - interface DiscoveryCategory { - id: number; - name: { - default: string; - localizations?: { [lang: string]: string }; - }; - is_primary: boolean; - } - - interface DiscoverySubcategoryResponse { - guild_id: string; - category_id: number; - } - export class Guild extends Base { afkChannelID: string | null; afkTimeout: number; From 52b46a635198f337d99b8a59878e0ec6ccc24e3a Mon Sep 17 00:00:00 2001 From: bsian03 Date: Thu, 14 Jan 2021 00:33:43 +0000 Subject: [PATCH 2/4] Add missing Client typings --- index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 93e236f28..c1fe73137 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1243,16 +1243,21 @@ declare namespace Eris { } export class Client extends EventEmitter { - bot?: boolean; + bot: boolean; channelGuildMap: { [s: string]: string }; gatewayURL?: string; groupChannels: Collection; guilds: Collection; guildShardMap: { [s: string]: number }; + lastConnect: number; + lastReconnectDelay: number; notes: { [s: string]: string }; options: ClientOptions; + presence: Presence; privateChannelMap: { [s: string]: string }; privateChannels: Collection; + ready: boolean; + reconnectAttempts: number; relationships: Collection; requestHandler: RequestHandler; shards: ShardManager; From e8ab640c44948b0bb80493c23d315f7342bc97ca Mon Sep 17 00:00:00 2001 From: Bsian Date: Fri, 29 Jan 2021 21:51:28 +0000 Subject: [PATCH 3/4] jsdoc fix --- lib/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Client.js b/lib/Client.js index fd9942b40..7c98156f8 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -50,7 +50,7 @@ const sleep = (ms) => new Promise((res) => setTimeout(res, ms)); /** * Represents the main Eris client * @extends EventEmitter -* @prop {Boolean?} bot Whether the bot user belongs to an OAuth2 application +* @prop {Boolean} bot Whether the bot user belongs to an OAuth2 application * @prop {Object} channelGuildMap Object mapping channel IDs to guild IDs * @prop {String} gatewayURL The URL for the discord gateway * @prop {Collection} groupChannels Collection of group channels the bot is in (user accounts only) From 09a1b423aaa40d1e7311b26970cf1ec29023fd6a Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 8 Feb 2021 16:23:12 +0000 Subject: [PATCH 4/4] Voice docs --- index.d.ts | 14 +++++++++----- lib/voice/VoiceConnection.js | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index c1fe73137..4f0a3f843 100644 --- a/index.d.ts +++ b/index.d.ts @@ -504,14 +504,17 @@ declare namespace Eris { (event: "disconnect", listener: (err: Error) => void): T; (event: "resume", listener: () => void): T; } + interface StreamEvents extends EventListeners { + (event: "end" | "start", listener: () => void): T; + (event: "error", listener: (err: Error) => void): T; + } interface VoiceEvents { + (event: "connect" | "end" | "ready" | "start", listener: () => void): T; (event: "debug" | "warn", listener: (message: string) => void): T; - (event: "error" | "disconnect", listener: (err: Error) => void): T; + (event: "disconnect" | "error", listener: (err?: Error) => void): T; (event: "pong", listener: (latency: number) => void): T; - (event: "speakingStart", listener: (userID: string) => void): T; - (event: "speakingStop", listener: (userID: string) => void): T; - (event: "end", listener: () => void): T; - (event: "userDisconnect", listener: (userID: string) => void): T; + (event: "speakingStart" | "speakingStop" | "userDisconnect", listener: (userID: string) => void): T; + (event: "unknown", listener: (packet: unknown) => void): T; } // Gateway/REST @@ -2254,6 +2257,7 @@ declare namespace Eris { setSpeaking(value: boolean): void; setVolume(volume: number): void; stopPlaying(): void; + on: StreamEvents; } export class StoreChannel extends GuildChannel { diff --git a/lib/voice/VoiceConnection.js b/lib/voice/VoiceConnection.js index 65f876198..44ee7a60d 100644 --- a/lib/voice/VoiceConnection.js +++ b/lib/voice/VoiceConnection.js @@ -477,7 +477,7 @@ class VoiceConnection extends EventEmitter { /** * Fired when the voice connection starts playing a stream - * @event SharedStream#start + * @event VoiceConnection#start */ this.emit("start");