diff --git a/src/structures/GuildEmoji.js b/src/structures/GuildEmoji.js index bfdb6ef..456b893 100644 --- a/src/structures/GuildEmoji.js +++ b/src/structures/GuildEmoji.js @@ -55,7 +55,7 @@ class GuildEmoji extends BaseGuildEmoji { * @readonly */ get deletable() { - if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME'); + if (!this.guild.members.me) throw new Error('GUILD_UNCACHED_ME'); return !this.managed && this.guild.members.me.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS); } diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index d9cda12..6ec2b3e 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -333,7 +333,7 @@ class GuildMember extends Base { if (this.user.id === this.guild.ownerId) return false; if (this.user.id === this.client.user.id) return false; if (this.client.user.id === this.guild.ownerId) return true; - if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME'); + if (!this.guild.members.me) throw new Error('GUILD_UNCACHED_ME'); return this.guild.members.me.roles.highest.comparePositionTo(this.roles.highest) > 0; } diff --git a/src/structures/Invite.js b/src/structures/Invite.js index 1da4353..c62b4e7 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -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)