From 93255168df0f6ff94d30cc9ffe43e7fdd286aabd Mon Sep 17 00:00:00 2001 From: Advaith Date: Thu, 15 Jul 2021 03:19:53 -0700 Subject: [PATCH 1/4] fix(User): fetch force parameter --- src/structures/User.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/User.js b/src/structures/User.js index 9fc048fa21bd..813fb4dffbaa 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -262,7 +262,7 @@ class User extends Base { * @returns {Promise} */ fetch(force = false) { - return this.client.users.fetch(this.id, true, force); + return this.client.users.fetch(this.id, { force }); } /** From e538f689ced50a425ca4caddc34d710cdfcc2d6c Mon Sep 17 00:00:00 2001 From: Advaith Date: Thu, 15 Jul 2021 03:36:29 -0700 Subject: [PATCH 2/4] fix: channel#fetch and message#fetch --- src/structures/Channel.js | 2 +- src/structures/Message.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/Channel.js b/src/structures/Channel.js index 9d1825048ffe..05fc24466c65 100644 --- a/src/structures/Channel.js +++ b/src/structures/Channel.js @@ -106,7 +106,7 @@ class Channel extends Base { * @returns {Promise} */ fetch(force = false) { - return this.client.channels.fetch(this.id, true, force); + return this.client.channels.fetch(this.id, { force }); } /** diff --git a/src/structures/Message.js b/src/structures/Message.js index 375fd8825768..d91aa6074473 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -725,7 +725,7 @@ class Message extends Base { * @returns {Promise} */ fetch(force = false) { - return this.channel.messages.fetch(this.id, true, force); + return this.channel.messages.fetch(this.id, { force }); } /** From 35abc38a233141ac57bbf8266ac2e85183a89d57 Mon Sep 17 00:00:00 2001 From: Advaith Date: Thu, 15 Jul 2021 04:08:54 -0700 Subject: [PATCH 3/4] feat: default to force fetching in instance#fetch --- src/structures/Channel.js | 2 +- src/structures/DMChannel.js | 2 +- src/structures/GuildBan.js | 2 +- src/structures/GuildMember.js | 2 +- src/structures/Message.js | 2 +- src/structures/User.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/structures/Channel.js b/src/structures/Channel.js index 05fc24466c65..ed24ba7ca6e1 100644 --- a/src/structures/Channel.js +++ b/src/structures/Channel.js @@ -105,7 +105,7 @@ class Channel extends Base { * @param {boolean} [force=false] Whether to skip the cache check and request the API * @returns {Promise} */ - fetch(force = false) { + fetch(force = true) { return this.client.channels.fetch(this.id, { force }); } diff --git a/src/structures/DMChannel.js b/src/structures/DMChannel.js index 4d549cddd94e..ea62a99717e2 100644 --- a/src/structures/DMChannel.js +++ b/src/structures/DMChannel.js @@ -66,7 +66,7 @@ class DMChannel extends Channel { * @param {boolean} [force=false] 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 b40e7c3ac9b9..c98a684351f2 100644 --- a/src/structures/GuildBan.js +++ b/src/structures/GuildBan.js @@ -55,7 +55,7 @@ class GuildBan extends Base { * @param {boolean} [force=false] 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 8d10126aaa77..c276a837d1f6 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -304,7 +304,7 @@ class GuildMember extends Base { * @param {boolean} [force=false] 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 d91aa6074473..040bfffaf135 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -724,7 +724,7 @@ class Message extends Base { * @param {boolean} [force=false] Whether to skip the cache check and request the API * @returns {Promise} */ - fetch(force = false) { + fetch(force = true) { return this.channel.messages.fetch(this.id, { force }); } diff --git a/src/structures/User.js b/src/structures/User.js index 813fb4dffbaa..4f56e4f20e5b 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -261,7 +261,7 @@ class User extends Base { * @param {boolean} [force=false] Whether to skip the cache check and request the API * @returns {Promise} */ - fetch(force = false) { + fetch(force = true) { return this.client.users.fetch(this.id, { force }); } From 8c86514047fbf0c995f510104c1e57891cc77d51 Mon Sep 17 00:00:00 2001 From: Advaith Date: Thu, 15 Jul 2021 05:04:59 -0700 Subject: [PATCH 4/4] fix default in docs Co-authored-by: Almeida --- src/structures/Channel.js | 2 +- src/structures/DMChannel.js | 2 +- src/structures/GuildBan.js | 2 +- src/structures/GuildMember.js | 2 +- src/structures/Message.js | 2 +- src/structures/User.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/structures/Channel.js b/src/structures/Channel.js index ed24ba7ca6e1..6dbcaa93214a 100644 --- a/src/structures/Channel.js +++ b/src/structures/Channel.js @@ -102,7 +102,7 @@ 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 = true) { diff --git a/src/structures/DMChannel.js b/src/structures/DMChannel.js index ea62a99717e2..d4d43c0ef932 100644 --- a/src/structures/DMChannel.js +++ b/src/structures/DMChannel.js @@ -63,7 +63,7 @@ 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 = true) { diff --git a/src/structures/GuildBan.js b/src/structures/GuildBan.js index c98a684351f2..0f06f75fa0ae 100644 --- a/src/structures/GuildBan.js +++ b/src/structures/GuildBan.js @@ -52,7 +52,7 @@ 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 = true) { diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index c276a837d1f6..606b9be8aedb 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -301,7 +301,7 @@ 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 = true) { diff --git a/src/structures/Message.js b/src/structures/Message.js index 040bfffaf135..dfa801cf03a4 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -721,7 +721,7 @@ 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 = true) { diff --git a/src/structures/User.js b/src/structures/User.js index 4f56e4f20e5b..75f104b74641 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -258,7 +258,7 @@ 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 = true) {