mirror of
https://github.com/danbulant/discord.js
synced 2026-07-05 03:00:35 +00:00
Webpack build for branch master: 36555c1cea
This commit is contained in:
parent
ac9e701a42
commit
b0bc35a612
2 changed files with 14 additions and 11 deletions
|
|
@ -3082,17 +3082,24 @@ class GuildMember extends Base {
|
||||||
return new Permissions(this.roles.map(role => role.permissions)).freeze();
|
return new Permissions(this.roles.map(role => role.permissions)).freeze();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the member is manageable in terms of role hierarchy by the client user
|
||||||
|
* @type {boolean}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
get manageable() {
|
||||||
|
if (this.user.id === this.guild.ownerID) return false;
|
||||||
|
if (this.user.id === this.client.user.id) return false;
|
||||||
|
return this.guild.me.highestRole.comparePositionTo(this.highestRole) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the member is kickable by the client user
|
* Whether the member is kickable by the client user
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get kickable() {
|
get kickable() {
|
||||||
if (this.user.id === this.guild.ownerID) return false;
|
return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.KICK_MEMBERS);
|
||||||
if (this.user.id === this.client.user.id) return false;
|
|
||||||
const clientMember = this.guild.member(this.client.user);
|
|
||||||
if (!clientMember.permissions.has(Permissions.FLAGS.KICK_MEMBERS)) return false;
|
|
||||||
return clientMember.highestRole.comparePositionTo(this.highestRole) > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3101,11 +3108,7 @@ class GuildMember extends Base {
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get bannable() {
|
get bannable() {
|
||||||
if (this.user.id === this.guild.ownerID) return false;
|
return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.BAN_MEMBERS);
|
||||||
if (this.user.id === this.client.user.id) return false;
|
|
||||||
const clientMember = this.guild.member(this.client.user);
|
|
||||||
if (!clientMember.permissions.has(Permissions.FLAGS.BAN_MEMBERS)) return false;
|
|
||||||
return clientMember.highestRole.comparePositionTo(this.highestRole) > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue