From b030130df179cb68749905248f280108c6a2956a Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Tue, 12 Oct 2021 18:35:16 +0100 Subject: [PATCH] docs: Replace `FetchOwnerOptions` type definition (#6814) --- src/managers/ChannelManager.js | 2 +- src/structures/Guild.js | 9 +-------- src/structures/ThreadChannel.js | 2 +- typings/index.d.ts | 6 ++---- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/managers/ChannelManager.js b/src/managers/ChannelManager.js index b705048f4..9fa408b00 100644 --- a/src/managers/ChannelManager.js +++ b/src/managers/ChannelManager.js @@ -88,7 +88,7 @@ class ChannelManager extends CachedManager { */ /** - * Options for fetching a channel from discord + * Options for fetching a channel from Discord * @typedef {BaseFetchOptions} FetchChannelOptions * @property {boolean} [allowUnknownGuild=false] Allows the channel to be returned even if the guild is not in cache, * it will not be cached. Many of the properties and methods on the returned channel will throw errors diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 7228522f8..338729409 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -486,17 +486,10 @@ class Guild extends AnonymousGuild { return this.discoverySplash && this.client.rest.cdn.DiscoverySplash(this.id, this.discoverySplash, format, size); } - /** - * Options used to fetch the owner of a guild or a thread. - * @typedef {Object} FetchOwnerOptions - * @property {boolean} [cache=true] Whether or not to cache the fetched member - * @property {boolean} [force=false] Whether to skip the cache check and request the API - */ - /** * Fetches the owner of the guild. * If the member object isn't needed, use {@link Guild#ownerId} instead. - * @param {FetchOwnerOptions} [options] The options for fetching the member + * @param {BaseFetchOptions} [options] The options for fetching the member * @returns {Promise} */ fetchOwner(options) { diff --git a/src/structures/ThreadChannel.js b/src/structures/ThreadChannel.js index 8d168dcac..f8fe7d86f 100644 --- a/src/structures/ThreadChannel.js +++ b/src/structures/ThreadChannel.js @@ -236,7 +236,7 @@ class ThreadChannel extends Channel { /** * Fetches the owner of this thread. If the thread member object isn't needed, * use {@link ThreadChannel#ownerId} instead. - * @param {FetchOwnerOptions} [options] The options for fetching the member + * @param {BaseFetchOptions} [options] The options for fetching the member * @returns {Promise} */ async fetchOwner({ cache = true, force = false } = {}) { diff --git a/typings/index.d.ts b/typings/index.d.ts index 4816402f9..f72d78d36 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -787,7 +787,7 @@ export class Guild extends AnonymousGuild { public equals(guild: Guild): boolean; public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise; public fetchIntegrations(): Promise>; - public fetchOwner(options?: FetchOwnerOptions): Promise; + public fetchOwner(options?: BaseFetchOptions): Promise; public fetchPreview(): Promise; public fetchTemplates(): Promise>; public fetchVanityData(): Promise; @@ -1991,7 +1991,7 @@ export class ThreadChannel extends TextBasedChannel(Channel) { public leave(): Promise; public permissionsFor(memberOrRole: GuildMember | Role): Readonly; public permissionsFor(memberOrRole: GuildMemberResolvable | RoleResolvable): Readonly | null; - public fetchOwner(options?: FetchOwnerOptions): Promise; + public fetchOwner(options?: BaseFetchOptions): Promise; public fetchStarterMessage(options?: BaseFetchOptions): Promise; public setArchived(archived?: boolean, reason?: string): Promise; public setAutoArchiveDuration( @@ -3924,8 +3924,6 @@ export interface FetchMembersOptions { force?: boolean; } -export type FetchOwnerOptions = Omit; - export interface FetchReactionUsersOptions { limit?: number; after?: Snowflake;