mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
feat: make Instance#fetch force true by default, and fix force parameter (#6116)
Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
@@ -102,11 +102,11 @@ class Channel extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches this channel.
|
* Fetches this channel.
|
||||||
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
* @param {boolean} [force=true] Whether to skip the cache check and request the API
|
||||||
* @returns {Promise<Channel>}
|
* @returns {Promise<Channel>}
|
||||||
*/
|
*/
|
||||||
fetch(force = false) {
|
fetch(force = true) {
|
||||||
return this.client.channels.fetch(this.id, true, force);
|
return this.client.channels.fetch(this.id, { force });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ class DMChannel extends Channel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch this DMChannel.
|
* Fetch this DMChannel.
|
||||||
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
* @param {boolean} [force=true] Whether to skip the cache check and request the API
|
||||||
* @returns {Promise<DMChannel>}
|
* @returns {Promise<DMChannel>}
|
||||||
*/
|
*/
|
||||||
fetch(force = false) {
|
fetch(force = true) {
|
||||||
return this.recipient.createDM(force);
|
return this.recipient.createDM(force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ class GuildBan extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches this GuildBan.
|
* Fetches this GuildBan.
|
||||||
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
* @param {boolean} [force=true] Whether to skip the cache check and request the API
|
||||||
* @returns {Promise<GuildBan>}
|
* @returns {Promise<GuildBan>}
|
||||||
*/
|
*/
|
||||||
fetch(force = false) {
|
fetch(force = true) {
|
||||||
return this.guild.bans.fetch({ user: this.user, cache: true, force });
|
return this.guild.bans.fetch({ user: this.user, cache: true, force });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,10 +301,10 @@ class GuildMember extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches this GuildMember.
|
* Fetches this GuildMember.
|
||||||
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
* @param {boolean} [force=true] Whether to skip the cache check and request the API
|
||||||
* @returns {Promise<GuildMember>}
|
* @returns {Promise<GuildMember>}
|
||||||
*/
|
*/
|
||||||
fetch(force = false) {
|
fetch(force = true) {
|
||||||
return this.guild.members.fetch({ user: this.id, cache: true, force });
|
return this.guild.members.fetch({ user: this.id, cache: true, force });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -721,11 +721,11 @@ class Message extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch this message.
|
* Fetch this message.
|
||||||
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
* @param {boolean} [force=true] Whether to skip the cache check and request the API
|
||||||
* @returns {Promise<Message>}
|
* @returns {Promise<Message>}
|
||||||
*/
|
*/
|
||||||
fetch(force = false) {
|
fetch(force = true) {
|
||||||
return this.channel.messages.fetch(this.id, true, force);
|
return this.channel.messages.fetch(this.id, { force });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -230,11 +230,11 @@ class User extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches this user.
|
* Fetches this user.
|
||||||
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
* @param {boolean} [force=true] Whether to skip the cache check and request the API
|
||||||
* @returns {Promise<User>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
fetch(force = false) {
|
fetch(force = true) {
|
||||||
return this.client.users.fetch(this.id, true, force);
|
return this.client.users.fetch(this.id, { force });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user