Skip to content

Commit

Permalink
fix(Message): only VIEW_CHANNEL permission required to edit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tignear committed Sep 8, 2021
1 parent a86b136 commit 331e2ca
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/structures/Message.js
Expand Up @@ -548,13 +548,7 @@ class Message extends Base {
* @readonly
*/
get editable() {
return Boolean(
this.author.id === this.client.user.id &&
!this.deleted &&
(!this.guild ||
(this.channel?.viewable &&
this.channel.permissionsFor(this.client.user)?.has(Permissions.FLAGS.SEND_MESSAGES, false))),
);
return Boolean(this.author.id === this.client.user.id && !this.deleted && (!this.guild || this.channel?.viewable));
}

/**
Expand Down

0 comments on commit 331e2ca

Please sign in to comment.