mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types(GuildChannelManager): correct fetch return type (v13) (#8551)
This commit is contained in:
@@ -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.
|
* 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 {Snowflake} [id] The channel's id
|
||||||
* @param {BaseFetchOptions} [options] Additional options for this fetch
|
* @param {BaseFetchOptions} [options] Additional options for this fetch
|
||||||
* @returns {Promise<?GuildChannel|Collection<Snowflake, GuildChannel>>}
|
* @returns {Promise<?GuildChannel|ThreadChannel|Collection<Snowflake, ?GuildChannel>>}
|
||||||
* @example
|
* @example
|
||||||
* // Fetch all channels from the guild (excluding threads)
|
* // Fetch all channels from the guild (excluding threads)
|
||||||
* message.guild.channels.fetch()
|
* message.guild.channels.fetch()
|
||||||
|
|||||||
7
typings/index.d.ts
vendored
7
typings/index.d.ts
vendored
@@ -3229,8 +3229,11 @@ export class GuildChannelManager extends CachedManager<Snowflake, GuildBasedChan
|
|||||||
options?: TextChannel | NewsChannel | VoiceChannel | Snowflake,
|
options?: TextChannel | NewsChannel | VoiceChannel | Snowflake,
|
||||||
): Promise<Webhook>;
|
): Promise<Webhook>;
|
||||||
public edit(channel: GuildChannelResolvable, data: ChannelData, reason?: string): Promise<GuildChannel>;
|
public edit(channel: GuildChannelResolvable, data: ChannelData, reason?: string): Promise<GuildChannel>;
|
||||||
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<NonThreadGuildBasedChannel | null>;
|
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<GuildBasedChannel | null>;
|
||||||
public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, NonThreadGuildBasedChannel>>;
|
public fetch(
|
||||||
|
id?: undefined,
|
||||||
|
options?: BaseFetchOptions,
|
||||||
|
): Promise<Collection<Snowflake, NonThreadGuildBasedChannel | null>>;
|
||||||
public fetchWebhooks(channel: GuildChannelResolvable): Promise<Collection<Snowflake, Webhook>>;
|
public fetchWebhooks(channel: GuildChannelResolvable): Promise<Collection<Snowflake, Webhook>>;
|
||||||
public setPosition(
|
public setPosition(
|
||||||
channel: GuildChannelResolvable,
|
channel: GuildChannelResolvable,
|
||||||
|
|||||||
@@ -908,9 +908,9 @@ declare const guildChannelManager: GuildChannelManager;
|
|||||||
expectType<Promise<StoreChannel>>(guildChannelManager.create('name', { type: 'GUILD_STORE' }));
|
expectType<Promise<StoreChannel>>(guildChannelManager.create('name', { type: 'GUILD_STORE' }));
|
||||||
expectType<Promise<StageChannel>>(guildChannelManager.create('name', { type: 'GUILD_STAGE_VOICE' }));
|
expectType<Promise<StageChannel>>(guildChannelManager.create('name', { type: 'GUILD_STAGE_VOICE' }));
|
||||||
|
|
||||||
expectType<Promise<Collection<Snowflake, AnyChannel>>>(guildChannelManager.fetch());
|
expectType<Promise<Collection<Snowflake, AnyChannel | null>>>(guildChannelManager.fetch());
|
||||||
expectType<Promise<Collection<Snowflake, AnyChannel>>>(guildChannelManager.fetch(undefined, {}));
|
expectType<Promise<Collection<Snowflake, AnyChannel | null>>>(guildChannelManager.fetch(undefined, {}));
|
||||||
expectType<Promise<AnyChannel | null>>(guildChannelManager.fetch('0'));
|
expectType<Promise<GuildBasedChannel | null>>(guildChannelManager.fetch('0'));
|
||||||
}
|
}
|
||||||
|
|
||||||
declare const roleManager: RoleManager;
|
declare const roleManager: RoleManager;
|
||||||
|
|||||||
Reference in New Issue
Block a user