From 366f3c910a370ff1e184afae054f957db9a98293 Mon Sep 17 00:00:00 2001 From: Advaith Date: Sat, 17 Jul 2021 04:25:23 -0700 Subject: [PATCH] feat: make Instance#fetch force true by default, and fix force parameter (#6116) Co-authored-by: Almeida --- src/structures/Channel.js | 6 +++--- src/structures/DMChannel.js | 4 ++-- src/structures/GuildBan.js | 4 ++-- src/structures/GuildMember.js | 4 ++-- src/structures/Message.js | 6 +++--- src/structures/User.js | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/structures/Channel.js b/src/structures/Channel.js index 9d1825048..6dbcaa932 100644 --- a/src/structures/Channel.js +++ b/src/structures/Channel.js @@ -102,11 +102,11 @@ class Channel extends Base { /** * 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} */ - fetch(force = false) { - return this.client.channels.fetch(this.id, true, force); + fetch(force = true) { + return this.client.channels.fetch(this.id, { force }); } /** diff --git a/src/structures/DMChannel.js b/src/structures/DMChannel.js index 5989cbfbe..7ebc159ba 100644 --- a/src/structures/DMChannel.js +++ b/src/structures/DMChannel.js @@ -62,10 +62,10 @@ class DMChannel extends Channel { /** * 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} */ - fetch(force = false) { + fetch(force = true) { return this.recipient.createDM(force); } diff --git a/src/structures/GuildBan.js b/src/structures/GuildBan.js index b40e7c3ac..0f06f75fa 100644 --- a/src/structures/GuildBan.js +++ b/src/structures/GuildBan.js @@ -52,10 +52,10 @@ class GuildBan extends Base { /** * 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} */ - fetch(force = false) { + fetch(force = true) { return this.guild.bans.fetch({ user: this.user, cache: true, force }); } } diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index 8d10126aa..606b9be8a 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -301,10 +301,10 @@ class GuildMember extends Base { /** * 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} */ - fetch(force = false) { + fetch(force = true) { return this.guild.members.fetch({ user: this.id, cache: true, force }); } diff --git a/src/structures/Message.js b/src/structures/Message.js index 375fd8825..dfa801cf0 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -721,11 +721,11 @@ class Message extends Base { /** * 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} */ - fetch(force = false) { - return this.channel.messages.fetch(this.id, true, force); + fetch(force = true) { + return this.channel.messages.fetch(this.id, { force }); } /** diff --git a/src/structures/User.js b/src/structures/User.js index bbe7f5530..b7731e69a 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -230,11 +230,11 @@ class User extends Base { /** * 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} */ - fetch(force = false) { - return this.client.users.fetch(this.id, true, force); + fetch(force = true) { + return this.client.users.fetch(this.id, { force }); } /**