Skip to content

Commit

Permalink
feat(GuildManager): allow setting with_counts to false (#6407)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaporoxx committed Aug 12, 2021
1 parent e6f48d8 commit 14aea12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/managers/GuildManager.js
Expand Up @@ -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
*/

/**
Expand All @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Expand Up @@ -3578,6 +3578,7 @@ export interface FetchedThreads {

export interface FetchGuildOptions extends BaseFetchOptions {
guild: GuildResolvable;
withCounts?: boolean;
}

export interface FetchGuildsOptions {
Expand Down

0 comments on commit 14aea12

Please sign in to comment.