From fedab077d2bd4161b8d6ef3c76fa5d1a716a52c4 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:50:30 +0000 Subject: [PATCH] fix(ThreadChannel): address parameter type on fetchOwner() --- packages/discord.js/src/structures/ThreadChannel.js | 8 +++++++- packages/discord.js/typings/index.d.ts | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/discord.js/src/structures/ThreadChannel.js b/packages/discord.js/src/structures/ThreadChannel.js index 074ff052ac59..e19455aa91bd 100644 --- a/packages/discord.js/src/structures/ThreadChannel.js +++ b/packages/discord.js/src/structures/ThreadChannel.js @@ -288,10 +288,16 @@ class ThreadChannel extends BaseChannel { return this.parent?.permissionsFor(memberOrRole, checkAdmin) ?? null; } + /** + * Options used to fetch a thread owner. + * @typedef {BaseFetchOptions} FetchThreadOwnerOptions + * @property {boolean} [withMember] Whether to also return the guild member associated with this thread member + */ + /** * Fetches the owner of this thread. If the thread member object isn't needed, * use {@link ThreadChannel#ownerId} instead. - * @param {BaseFetchOptions} [options] The options for fetching the member + * @param {FetchThreadOwnerOptions} [options] Options for fetching the owner * @returns {Promise} */ async fetchOwner(options) { diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 537b04ac6131..3742b55f65ff 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -3377,7 +3377,7 @@ export class ThreadChannel extends BaseCha memberOrRole: GuildMemberResolvable | RoleResolvable, checkAdmin?: boolean, ): Readonly | null; - public fetchOwner(options?: BaseFetchOptions): Promise; + public fetchOwner(options?: FetchThreadOwnerOptions): Promise; public fetchStarterMessage(options?: BaseFetchOptions): Promise | null>; public setArchived(archived?: boolean, reason?: string): Promise; public setAutoArchiveDuration(autoArchiveDuration: ThreadAutoArchiveDuration, reason?: string): Promise; @@ -5854,6 +5854,10 @@ export interface FetchThreadMemberOptions extends BaseFetchOptions { withMember?: boolean; } +export interface FetchThreadOwnerOptions extends BaseFetchOptions { + withMember?: boolean; +} + export interface FetchThreadMembersWithGuildMemberDataOptions { withMember: true; after?: Snowflake;