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

types(GuildChannelManager): correct fetch return type (v13) #8551

Merged
merged 5 commits into from Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/managers/GuildChannelManager.js
Expand Up @@ -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<?GuildChannel|Collection<Snowflake, GuildChannel>>}
* @returns {Promise<?(GuildChannel|ThreadChannel|Collection<Snowflake, GuildChannel>)>}
* @example
* // Fetch all channels from the guild (excluding threads)
* message.guild.channels.fetch()
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -3232,7 +3232,7 @@ export class GuildChannelManager extends CachedManager<Snowflake, GuildBasedChan
options?: ChannelWebhookCreateOptions,
): Promise<Webhook>;
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 fetchWebhooks(channel: GuildChannelResolvable): Promise<Collection<Snowflake, Webhook>>;
public setPosition(
Expand Down
2 changes: 1 addition & 1 deletion typings/index.test-d.ts
Expand Up @@ -910,7 +910,7 @@ declare const guildChannelManager: GuildChannelManager;

expectType<Promise<Collection<Snowflake, AnyChannel>>>(guildChannelManager.fetch());
expectType<Promise<Collection<Snowflake, AnyChannel>>>(guildChannelManager.fetch(undefined, {}));
expectType<Promise<AnyChannel | null>>(guildChannelManager.fetch('0'));
expectType<Promise<GuildBasedChannel | null>>(guildChannelManager.fetch('0'));
}

declare const roleManager: RoleManager;
Expand Down