Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make Instance#fetch force true by default, and fix force parameter #6116

Merged
merged 4 commits into from Jul 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/structures/Channel.js
Expand Up @@ -105,8 +105,8 @@ class Channel extends Base {
* @param {boolean} [force=false] Whether to skip the cache check and request the API
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
* @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
2 changes: 1 addition & 1 deletion src/structures/DMChannel.js
Expand Up @@ -66,7 +66,7 @@ class DMChannel extends Channel {
* @param {boolean} [force=false] Whether to skip the cache check and request the API
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
* @returns {Promise<DMChannel>}
*/
fetch(force = false) {
fetch(force = true) {
return this.recipient.createDM(force);
}

Expand Down
2 changes: 1 addition & 1 deletion src/structures/GuildBan.js
Expand Up @@ -55,7 +55,7 @@ class GuildBan extends Base {
* @param {boolean} [force=false] Whether to skip the cache check and request the API
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
* @returns {Promise<GuildBan>}
*/
fetch(force = false) {
fetch(force = true) {
return this.guild.bans.fetch({ user: this.user, cache: true, force });
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/structures/GuildMember.js
Expand Up @@ -304,7 +304,7 @@ class GuildMember extends Base {
* @param {boolean} [force=false] Whether to skip the cache check and request the API
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
* @returns {Promise<GuildMember>}
*/
fetch(force = false) {
fetch(force = true) {
return this.guild.members.fetch({ user: this.id, cache: true, force });
}

Expand Down
4 changes: 2 additions & 2 deletions src/structures/Message.js
Expand Up @@ -724,8 +724,8 @@ class Message extends Base {
* @param {boolean} [force=false] Whether to skip the cache check and request the API
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
* @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
4 changes: 2 additions & 2 deletions src/structures/User.js
Expand Up @@ -261,8 +261,8 @@ class User extends Base {
* @param {boolean} [force=false] Whether to skip the cache check and request the API
advaith1 marked this conversation as resolved.
Show resolved Hide resolved
* @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