From f4e81330bf35bac0d8317dbb170312422df432fa Mon Sep 17 00:00:00 2001 From: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Date: Tue, 13 Sep 2022 02:10:47 -0500 Subject: [PATCH] types(GuildChannelManager): correct fetch return type (v13) (#8551) --- src/managers/GuildChannelManager.js | 2 +- typings/index.d.ts | 7 +++++-- typings/index.test-d.ts | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/managers/GuildChannelManager.js b/src/managers/GuildChannelManager.js index 8212bcf2c076..2967402a57bf 100644 --- a/src/managers/GuildChannelManager.js +++ b/src/managers/GuildChannelManager.js @@ -324,7 +324,7 @@ class GuildChannelManager extends CachedManager { * Obtains one or more guild channels from Discord, or the channel cache if they're already available. * @param {Snowflake} [id] The channel's id * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise>} + * @returns {Promise>} * @example * // Fetch all channels from the guild (excluding threads) * message.guild.channels.fetch() diff --git a/typings/index.d.ts b/typings/index.d.ts index d75b2784aacc..3b5f637fefed 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3229,8 +3229,11 @@ export class GuildChannelManager extends CachedManager; public edit(channel: GuildChannelResolvable, data: ChannelData, reason?: string): Promise; - public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; - public fetch(id?: undefined, options?: BaseFetchOptions): Promise>; + public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; + public fetch( + id?: undefined, + options?: BaseFetchOptions, + ): Promise>; public fetchWebhooks(channel: GuildChannelResolvable): Promise>; public setPosition( channel: GuildChannelResolvable, diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index 425d09e75f63..1108c3bb3b6c 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -908,9 +908,9 @@ declare const guildChannelManager: GuildChannelManager; expectType>(guildChannelManager.create('name', { type: 'GUILD_STORE' })); expectType>(guildChannelManager.create('name', { type: 'GUILD_STAGE_VOICE' })); - expectType>>(guildChannelManager.fetch()); - expectType>>(guildChannelManager.fetch(undefined, {})); - expectType>(guildChannelManager.fetch('0')); + expectType>>(guildChannelManager.fetch()); + expectType>>(guildChannelManager.fetch(undefined, {})); + expectType>(guildChannelManager.fetch('0')); } declare const roleManager: RoleManager;