Skip to content

Commit a0fe0ac

Browse files
authoredDec 14, 2021
fix(Message): remove usage of .deleted (#7109)
1 parent d43f684 commit a0fe0ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/structures/Message.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class Message extends Base {
584584
*/
585585
get editable() {
586586
const precheck = Boolean(
587-
this.author.id === this.client.user.id && !this.deleted && (!this.guild || this.channel?.viewable),
587+
this.author.id === this.client.user.id && !deletedMessages.has(this) && (!this.guild || this.channel?.viewable),
588588
);
589589
// Regardless of permissions thread messages cannot be edited if
590590
// the thread is locked.
@@ -600,7 +600,7 @@ class Message extends Base {
600600
* @readonly
601601
*/
602602
get deletable() {
603-
if (this.deleted) {
603+
if (deletedMessages.has(this)) {
604604
return false;
605605
}
606606
if (!this.guild) {
@@ -625,7 +625,7 @@ class Message extends Base {
625625
const { channel } = this;
626626
return Boolean(
627627
!this.system &&
628-
!this.deleted &&
628+
!deletedMessages.has(this) &&
629629
(!this.guild ||
630630
(channel?.viewable &&
631631
channel?.permissionsFor(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES, false))),
@@ -661,7 +661,7 @@ class Message extends Base {
661661
this.type === 'DEFAULT' &&
662662
channel.viewable &&
663663
channel.permissionsFor(this.client.user)?.has(bitfield, false) &&
664-
!this.deleted,
664+
!deletedMessages.has(this),
665665
);
666666
}
667667

0 commit comments

Comments
 (0)
Please sign in to comment.