feat(GuildManager): allow setting with_counts to false (#6407)

This commit is contained in:
Jan
2021-08-12 23:12:11 +02:00
committed by GitHub
parent e6f48d849f
commit 14aea12900
2 changed files with 3 additions and 1 deletions

View File

@@ -246,6 +246,7 @@ class GuildManager extends CachedManager {
* Options used to fetch a single guild.
* @typedef {BaseFetchOptions} FetchGuildOptions
* @property {GuildResolvable} guild The guild to fetch
* @property {boolean} [withCounts=true] Whether the approximate member and presence counts should be returned
*/
/**
@@ -270,7 +271,7 @@ class GuildManager extends CachedManager {
if (existing) return existing;
}
const data = await this.client.api.guilds(id).get({ query: { with_counts: true } });
const data = await this.client.api.guilds(id).get({ query: { with_counts: options.withCounts ?? true } });
return this._add(data, options.cache);
}

1
typings/index.d.ts vendored
View File

@@ -3578,6 +3578,7 @@ export interface FetchedThreads {
export interface FetchGuildOptions extends BaseFetchOptions {
guild: GuildResolvable;
withCounts?: boolean;
}
export interface FetchGuildsOptions {