mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
fix(Message): update getters to take null permissions into account (#5066)
* fix(Message): update message#delete * refactor(Message): message#deletable avoid duplicate call * Update Message.js * fix(message): resolve syntax errors * chore(message): resolve linting issues (death to the gh web panel) * Update Message.js * death to the github web panel * Update src/structures/Message.js Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com> Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
This commit is contained in:
@@ -386,10 +386,10 @@ class Message extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get deletable() {
|
||||
return (
|
||||
return Boolean(
|
||||
!this.deleted &&
|
||||
(this.author.id === this.client.user.id ||
|
||||
(this.guild && this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_MESSAGES, false)))
|
||||
(this.author.id === this.client.user.id ||
|
||||
this.channel.permissionsFor?.(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user