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 * @readonly
*/ */
get pinnable() { get pinnable() {
return ( return Boolean(
this.type === 'DEFAULT' && !this.system &&
(!this.guild || this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_MESSAGES, false)) (!this.guild || this.channel.permissionsFor(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES, false)),
); );
} }