Skip to content

Commit

Permalink
feat: make Instance#fetch force true by default, and fix force parame…
Browse files Browse the repository at this point in the history
…ter (#6116)

Co-authored-by: Almeida <almeidx@pm.me>
  • Loading branch information
advaith1 and almeidx committed Jul 17, 2021
1 parent ef5ba05 commit 366f3c9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/structures/Channel.js
Expand Up @@ -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<Channel>}
*/
fetch(force = false) {
return this.client.channels.fetch(this.id, true, force);
fetch(force = true) {
return this.client.channels.fetch(this.id, { force });
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/structures/DMChannel.js
Expand Up @@ -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<DMChannel>}
*/
fetch(force = false) {
fetch(force = true) {
return this.recipient.createDM(force);
}

Expand Down
4 changes: 2 additions & 2 deletions src/structures/GuildBan.js
Expand Up @@ -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<GuildBan>}
*/
fetch(force = false) {
fetch(force = true) {
return this.guild.bans.fetch({ user: this.user, cache: true, force });
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/structures/GuildMember.js
Expand Up @@ -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<GuildMember>}
*/
fetch(force = false) {
fetch(force = true) {
return this.guild.members.fetch({ user: this.id, cache: true, force });
}

Expand Down
6 changes: 3 additions & 3 deletions src/structures/Message.js
Expand Up @@ -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<Message>}
*/
fetch(force = false) {
return this.channel.messages.fetch(this.id, true, force);
fetch(force = true) {
return this.channel.messages.fetch(this.id, { force });
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/structures/User.js
Expand Up @@ -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<User>}
*/
fetch(force = false) {
return this.client.users.fetch(this.id, true, force);
fetch(force = true) {
return this.client.users.fetch(this.id, { force });
}

/**
Expand Down

0 comments on commit 366f3c9

Please sign in to comment.