refactor: Move me and add fetchMe() (fix)

This commit is contained in:
March 7th
2023-01-11 18:03:13 +07:00
parent bacb672045
commit 83f4181ec7
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ class Invite extends Base {
get deletable() {
const guild = this.guild;
if (!guild || !this.client.guilds.cache.has(guild.id)) return false;
if (!guild.me) throw new Error('GUILD_UNCACHED_ME');
if (!guild.members.me) throw new Error('GUILD_UNCACHED_ME');
return (
this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false) ||
guild.members.me.permissions.has(Permissions.FLAGS.MANAGE_GUILD)