mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(ThreadChannel): add ThreadChannel#viewable (#6975)
This commit is contained in:
@@ -551,7 +551,15 @@ class Message extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get editable() {
|
||||
return Boolean(this.author.id === this.client.user.id && !this.deleted && (!this.guild || this.channel?.viewable));
|
||||
const precheck = Boolean(
|
||||
this.author.id === this.client.user.id && !this.deleted && (!this.guild || this.channel?.viewable),
|
||||
);
|
||||
// Regardless of permissions thread messages cannot be edited if
|
||||
// the thread is locked.
|
||||
if (this.channel?.isThread()) {
|
||||
return precheck && !this.channel.locked;
|
||||
}
|
||||
return precheck;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user