mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
refactor(GuildMember): throw better errors on #kickable and #bannable (#7137)
This commit is contained in:
@@ -243,6 +243,7 @@ class GuildMember extends Base {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get kickable() {
|
get kickable() {
|
||||||
|
if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME');
|
||||||
return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.KICK_MEMBERS);
|
return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.KICK_MEMBERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,6 +253,7 @@ class GuildMember extends Base {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get bannable() {
|
get bannable() {
|
||||||
|
if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME');
|
||||||
return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.BAN_MEMBERS);
|
return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.BAN_MEMBERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user