mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
fix(Message): remove usage of .deleted (#7109)
This commit is contained in:
@@ -584,7 +584,7 @@ class Message extends Base {
|
|||||||
*/
|
*/
|
||||||
get editable() {
|
get editable() {
|
||||||
const precheck = Boolean(
|
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
|
// Regardless of permissions thread messages cannot be edited if
|
||||||
// the thread is locked.
|
// the thread is locked.
|
||||||
@@ -600,7 +600,7 @@ class Message extends Base {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get deletable() {
|
get deletable() {
|
||||||
if (this.deleted) {
|
if (deletedMessages.has(this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!this.guild) {
|
if (!this.guild) {
|
||||||
@@ -625,7 +625,7 @@ class Message extends Base {
|
|||||||
const { channel } = this;
|
const { channel } = this;
|
||||||
return Boolean(
|
return Boolean(
|
||||||
!this.system &&
|
!this.system &&
|
||||||
!this.deleted &&
|
!deletedMessages.has(this) &&
|
||||||
(!this.guild ||
|
(!this.guild ||
|
||||||
(channel?.viewable &&
|
(channel?.viewable &&
|
||||||
channel?.permissionsFor(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES, false))),
|
channel?.permissionsFor(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES, false))),
|
||||||
@@ -661,7 +661,7 @@ class Message extends Base {
|
|||||||
this.type === 'DEFAULT' &&
|
this.type === 'DEFAULT' &&
|
||||||
channel.viewable &&
|
channel.viewable &&
|
||||||
channel.permissionsFor(this.client.user)?.has(bitfield, false) &&
|
channel.permissionsFor(this.client.user)?.has(bitfield, false) &&
|
||||||
!this.deleted,
|
!deletedMessages.has(this),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user