Skip to content

Commit

Permalink
fix(Message): remove usage of .deleted (#7109)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Dec 14, 2021
1 parent d43f684 commit a0fe0ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/structures/Message.js
Expand Up @@ -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.
Expand All @@ -600,7 +600,7 @@ class Message extends Base {
* @readonly
*/
get deletable() {
if (this.deleted) {
if (deletedMessages.has(this)) {
return false;
}
if (!this.guild) {
Expand All @@ -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))),
Expand Down Expand Up @@ -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),
);
}

Expand Down

0 comments on commit a0fe0ac

Please sign in to comment.