diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index e409f6d91..c3838d165 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -263,7 +263,7 @@ class GuildMember { if (this.user.id === this.guild.ownerID) return false; if (this.user.id === this.client.user.id) return false; const clientMember = this.guild.member(this.client.user); - if (!clientMember.hasPermission(Permissions.FLAGS.KICK_MEMBERS)) return false; + if (!clientMember.permissions.has(Permissions.FLAGS.KICK_MEMBERS)) return false; return clientMember.highestRole.comparePositionTo(this.highestRole) > 0; } @@ -276,7 +276,7 @@ class GuildMember { if (this.user.id === this.guild.ownerID) return false; if (this.user.id === this.client.user.id) return false; const clientMember = this.guild.member(this.client.user); - if (!clientMember.hasPermission(Permissions.FLAGS.BAN_MEMBERS)) return false; + if (!clientMember.permissions.has(Permissions.FLAGS.BAN_MEMBERS)) return false; return clientMember.highestRole.comparePositionTo(this.highestRole) > 0; } @@ -319,7 +319,7 @@ class GuildMember { */ hasPermissions(permissions, explicit = false) { if (!explicit && this.user.id === this.guild.ownerID) return true; - return permissions.every(p => this.hasPermission(p, explicit)); + return this.hasPermission(permissions, explicit); } /** @@ -329,7 +329,7 @@ class GuildMember { * @returns {PermissionResolvable[]} */ missingPermissions(permissions, explicit = false) { - return permissions.filter(p => !this.hasPermission(p, explicit)); + return permissions.missing(permissions, explicit); } /** diff --git a/src/structures/Role.js b/src/structures/Role.js index 80348e88b..d5ffb33b1 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -120,7 +120,7 @@ class Role { get editable() { if (this.managed) return false; const clientMember = this.guild.member(this.client.user); - if (!clientMember.hasPermission(Permissions.FLAGS.MANAGE_ROLES_OR_PERMISSIONS)) return false; + if (!clientMember.permissions.has(Permissions.FLAGS.MANAGE_ROLES_OR_PERMISSIONS)) return false; return clientMember.highestRole.comparePositionTo(this) > 0; } diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index ec665e556..f7fde7319 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -456,7 +456,7 @@ const Deprecated = { * @deprecated */ sendFile(attachment, name, content, options = {}) { - return this.sendFiles([{ attachment, name }], content, options); + return this.send({ files: [{ attachment, name }], content, options }); }, /**