Skip to content

Commit 56c9396

Browse files
authored
fix(ThreadChannel): Address parameter type on fetchOwner() (#10592)
fix(ThreadChannel): address parameter type on fetchOwner()
1 parent 21c283f commit 56c9396

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/discord.js/src/structures/ThreadChannel.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,16 @@ class ThreadChannel extends BaseChannel {
288288
return this.parent?.permissionsFor(memberOrRole, checkAdmin) ?? null;
289289
}
290290

291+
/**
292+
* Options used to fetch a thread owner.
293+
* @typedef {BaseFetchOptions} FetchThreadOwnerOptions
294+
* @property {boolean} [withMember] Whether to also return the guild member associated with this thread member
295+
*/
296+
291297
/**
292298
* Fetches the owner of this thread. If the thread member object isn't needed,
293299
* use {@link ThreadChannel#ownerId} instead.
294-
* @param {BaseFetchOptions} [options] The options for fetching the member
300+
* @param {FetchThreadOwnerOptions} [options] Options for fetching the owner
295301
* @returns {Promise<?ThreadMember>}
296302
*/
297303
async fetchOwner(options) {

packages/discord.js/typings/index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3377,7 +3377,7 @@ export class ThreadChannel<ThreadOnly extends boolean = boolean> extends BaseCha
33773377
memberOrRole: GuildMemberResolvable | RoleResolvable,
33783378
checkAdmin?: boolean,
33793379
): Readonly<PermissionsBitField> | null;
3380-
public fetchOwner(options?: BaseFetchOptions): Promise<ThreadMember | null>;
3380+
public fetchOwner(options?: FetchThreadOwnerOptions): Promise<ThreadMember | null>;
33813381
public fetchStarterMessage(options?: BaseFetchOptions): Promise<Message<true> | null>;
33823382
public setArchived(archived?: boolean, reason?: string): Promise<this>;
33833383
public setAutoArchiveDuration(autoArchiveDuration: ThreadAutoArchiveDuration, reason?: string): Promise<this>;
@@ -5854,6 +5854,10 @@ export interface FetchThreadMemberOptions extends BaseFetchOptions {
58545854
withMember?: boolean;
58555855
}
58565856

5857+
export interface FetchThreadOwnerOptions extends BaseFetchOptions {
5858+
withMember?: boolean;
5859+
}
5860+
58575861
export interface FetchThreadMembersWithGuildMemberDataOptions {
58585862
withMember: true;
58595863
after?: Snowflake;

0 commit comments

Comments
 (0)