mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
docs: Replace FetchOwnerOptions type definition (#6814)
This commit is contained in:
@@ -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
|
* @typedef {BaseFetchOptions} FetchChannelOptions
|
||||||
* @property {boolean} [allowUnknownGuild=false] Allows the channel to be returned even if the guild is not in cache,
|
* @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>
|
* it will not be cached. <warn>Many of the properties and methods on the returned channel will throw errors</warn>
|
||||||
|
|||||||
@@ -486,17 +486,10 @@ class Guild extends AnonymousGuild {
|
|||||||
return this.discoverySplash && this.client.rest.cdn.DiscoverySplash(this.id, this.discoverySplash, format, size);
|
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.
|
* Fetches the owner of the guild.
|
||||||
* If the member object isn't needed, use {@link Guild#ownerId} instead.
|
* 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>}
|
* @returns {Promise<GuildMember>}
|
||||||
*/
|
*/
|
||||||
fetchOwner(options) {
|
fetchOwner(options) {
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ class ThreadChannel extends Channel {
|
|||||||
/**
|
/**
|
||||||
* Fetches the owner of this thread. If the thread member object isn't needed,
|
* Fetches the owner of this thread. If the thread member object isn't needed,
|
||||||
* use {@link ThreadChannel#ownerId} instead.
|
* 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>}
|
* @returns {Promise<?ThreadMember>}
|
||||||
*/
|
*/
|
||||||
async fetchOwner({ cache = true, force = false } = {}) {
|
async fetchOwner({ cache = true, force = false } = {}) {
|
||||||
|
|||||||
6
typings/index.d.ts
vendored
6
typings/index.d.ts
vendored
@@ -787,7 +787,7 @@ export class Guild extends AnonymousGuild {
|
|||||||
public equals(guild: Guild): boolean;
|
public equals(guild: Guild): boolean;
|
||||||
public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
|
public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
|
||||||
public fetchIntegrations(): Promise<Collection<Snowflake | string, Integration>>;
|
public fetchIntegrations(): Promise<Collection<Snowflake | string, Integration>>;
|
||||||
public fetchOwner(options?: FetchOwnerOptions): Promise<GuildMember>;
|
public fetchOwner(options?: BaseFetchOptions): Promise<GuildMember>;
|
||||||
public fetchPreview(): Promise<GuildPreview>;
|
public fetchPreview(): Promise<GuildPreview>;
|
||||||
public fetchTemplates(): Promise<Collection<GuildTemplate['code'], GuildTemplate>>;
|
public fetchTemplates(): Promise<Collection<GuildTemplate['code'], GuildTemplate>>;
|
||||||
public fetchVanityData(): Promise<Vanity>;
|
public fetchVanityData(): Promise<Vanity>;
|
||||||
@@ -1991,7 +1991,7 @@ export class ThreadChannel extends TextBasedChannel(Channel) {
|
|||||||
public leave(): Promise<ThreadChannel>;
|
public leave(): Promise<ThreadChannel>;
|
||||||
public permissionsFor(memberOrRole: GuildMember | Role): Readonly<Permissions>;
|
public permissionsFor(memberOrRole: GuildMember | Role): Readonly<Permissions>;
|
||||||
public permissionsFor(memberOrRole: GuildMemberResolvable | RoleResolvable): Readonly<Permissions> | null;
|
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 fetchStarterMessage(options?: BaseFetchOptions): Promise<Message>;
|
||||||
public setArchived(archived?: boolean, reason?: string): Promise<ThreadChannel>;
|
public setArchived(archived?: boolean, reason?: string): Promise<ThreadChannel>;
|
||||||
public setAutoArchiveDuration(
|
public setAutoArchiveDuration(
|
||||||
@@ -3924,8 +3924,6 @@ export interface FetchMembersOptions {
|
|||||||
force?: boolean;
|
force?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FetchOwnerOptions = Omit<FetchMemberOptions, 'user'>;
|
|
||||||
|
|
||||||
export interface FetchReactionUsersOptions {
|
export interface FetchReactionUsersOptions {
|
||||||
limit?: number;
|
limit?: number;
|
||||||
after?: Snowflake;
|
after?: Snowflake;
|
||||||
|
|||||||
Reference in New Issue
Block a user