Skip to content

Commit

Permalink
docs: Replace FetchOwnerOptions type definition (#6814)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored Oct 12, 2021
1 parent d57ec7a commit b030130
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/managers/ChannelManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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. <warn>Many of the properties and methods on the returned channel will throw errors</warn>
Expand Down
9 changes: 1 addition & 8 deletions src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<GuildMember>}
*/
fetchOwner(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/structures/ThreadChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<?ThreadMember>}
*/
async fetchOwner({ cache = true, force = false } = {}) {
Expand Down
6 changes: 2 additions & 4 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ export class Guild extends AnonymousGuild {
public equals(guild: Guild): boolean;
public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
public fetchIntegrations(): Promise<Collection<Snowflake | string, Integration>>;
public fetchOwner(options?: FetchOwnerOptions): Promise<GuildMember>;
public fetchOwner(options?: BaseFetchOptions): Promise<GuildMember>;
public fetchPreview(): Promise<GuildPreview>;
public fetchTemplates(): Promise<Collection<GuildTemplate['code'], GuildTemplate>>;
public fetchVanityData(): Promise<Vanity>;
Expand Down Expand Up @@ -1991,7 +1991,7 @@ export class ThreadChannel extends TextBasedChannel(Channel) {
public leave(): Promise<ThreadChannel>;
public permissionsFor(memberOrRole: GuildMember | Role): Readonly<Permissions>;
public permissionsFor(memberOrRole: GuildMemberResolvable | RoleResolvable): Readonly<Permissions> | null;
public fetchOwner(options?: FetchOwnerOptions): Promise<ThreadMember | null>;
public fetchOwner(options?: BaseFetchOptions): Promise<ThreadMember | null>;
public fetchStarterMessage(options?: BaseFetchOptions): Promise<Message>;
public setArchived(archived?: boolean, reason?: string): Promise<ThreadChannel>;
public setAutoArchiveDuration(
Expand Down Expand Up @@ -3924,8 +3924,6 @@ export interface FetchMembersOptions {
force?: boolean;
}

export type FetchOwnerOptions = Omit<FetchMemberOptions, 'user'>;

export interface FetchReactionUsersOptions {
limit?: number;
after?: Snowflake;
Expand Down

0 comments on commit b030130

Please sign in to comment.