Skip to content

Commit

Permalink
fix(ThreadChannel): address parameter type on fetchOwner()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Nov 5, 2024
1 parent 13471fa commit fedab07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/discord.js/src/structures/ThreadChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<?ThreadMember>}
*/
async fetchOwner(options) {
Expand Down
6 changes: 5 additions & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3377,7 +3377,7 @@ export class ThreadChannel<ThreadOnly extends boolean = boolean> extends BaseCha
memberOrRole: GuildMemberResolvable | RoleResolvable,
checkAdmin?: boolean,
): Readonly<PermissionsBitField> | null;
public fetchOwner(options?: BaseFetchOptions): Promise<ThreadMember | null>;
public fetchOwner(options?: FetchThreadOwnerOptions): Promise<ThreadMember | null>;
public fetchStarterMessage(options?: BaseFetchOptions): Promise<Message<true> | null>;
public setArchived(archived?: boolean, reason?: string): Promise<this>;
public setAutoArchiveDuration(autoArchiveDuration: ThreadAutoArchiveDuration, reason?: string): Promise<this>;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fedab07

Please sign in to comment.