From a0fe0acbf1c0134d88d9fc519506cf33116288cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Rom=C3=A1n?= Date: Tue, 14 Dec 2021 21:10:14 +0100 Subject: [PATCH] fix(Message): remove usage of `.deleted` (#7109) --- src/structures/Message.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index 6acc66369..dc29d5cba 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -584,7 +584,7 @@ class Message extends Base { */ get editable() { const precheck = Boolean( - this.author.id === this.client.user.id && !this.deleted && (!this.guild || this.channel?.viewable), + this.author.id === this.client.user.id && !deletedMessages.has(this) && (!this.guild || this.channel?.viewable), ); // Regardless of permissions thread messages cannot be edited if // the thread is locked. @@ -600,7 +600,7 @@ class Message extends Base { * @readonly */ get deletable() { - if (this.deleted) { + if (deletedMessages.has(this)) { return false; } if (!this.guild) { @@ -625,7 +625,7 @@ class Message extends Base { const { channel } = this; return Boolean( !this.system && - !this.deleted && + !deletedMessages.has(this) && (!this.guild || (channel?.viewable && channel?.permissionsFor(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES, false))), @@ -661,7 +661,7 @@ class Message extends Base { this.type === 'DEFAULT' && channel.viewable && channel.permissionsFor(this.client.user)?.has(bitfield, false) && - !this.deleted, + !deletedMessages.has(this), ); }