fix(ThreadChannel): Address parameter type on fetchOwner() (#10579)

* fix(ThreadChannel): address parameter on owner helper method

* docs: fix description

Co-authored-by: Almeida <github@almeidx.dev>

---------

Co-authored-by: Almeida <github@almeidx.dev>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2024-11-05 22:19:48 +00:00
committed by GitHub
parent 1184b38d3e
commit c34a57b798
2 changed files with 13 additions and 3 deletions

View File

@@ -287,11 +287,17 @@ 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
* @returns {Promise<?ThreadMember>}
* @param {FetchThreadOwnerOptions} [options] Options for fetching the owner
* @returns {Promise<ThreadMember>}
*/
async fetchOwner(options) {
if (!this.ownerId) {

View File

@@ -3318,7 +3318,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>;
public fetchStarterMessage(options?: BaseFetchOptions): Promise<Message<true> | null>;
public setArchived(archived?: boolean, reason?: string): Promise<this>;
public setAutoArchiveDuration(autoArchiveDuration: ThreadAutoArchiveDuration, reason?: string): Promise<this>;
@@ -5565,6 +5565,10 @@ export interface FetchThreadMemberOptions extends BaseFetchOptions {
withMember?: boolean;
}
export interface FetchThreadOwnerOptions extends BaseFetchOptions {
withMember?: boolean;
}
export interface FetchThreadMembersWithGuildMemberDataOptions {
withMember: true;
after?: Snowflake;