fix(Message): pinnable returning false in non-DEFAULT messages (#6585)

This commit is contained in:
Rodry
2021-09-09 18:51:21 +01:00
committed by GitHub
parent f866512e84
commit 3183b1166a

View File

@@ -570,9 +570,9 @@ class Message extends Base {
* @readonly
*/
get pinnable() {
return (
this.type === 'DEFAULT' &&
(!this.guild || this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_MESSAGES, false))
return Boolean(
!this.system &&
(!this.guild || this.channel.permissionsFor(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES, false)),
);
}