mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat: throw custom error for uncached Guild#me (#3271)
* handle cases where Guild#me is uncached * fix id prop * remove unnecessary checks * space's requested changes
This commit is contained in:
@@ -100,6 +100,7 @@ class Invite extends Base {
|
||||
get deletable() {
|
||||
const guild = this.guild;
|
||||
if (!guild || !this.client.guilds.has(guild.id)) return false;
|
||||
if (!guild.me) throw new Error('GUILD_UNCACHED_ME');
|
||||
return this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false) ||
|
||||
guild.me.permissions.has(Permissions.FLAGS.MANAGE_GUILD);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user