fix(GuildEmoji): consider CreateGuildExpressions in deletable

This commit is contained in:
Danial Raza
2026-09-09 23:53:42 +02:00
parent a4116036be
commit b89b26aea8
@@ -61,7 +61,12 @@ class GuildEmoji extends BaseGuildEmoji {
*/
get deletable() {
if (!this.guild.members.me) throw new DiscordjsError(ErrorCodes.GuildUncachedMe);
return !this.managed && this.guild.members.me.permissions.has(PermissionFlagsBits.ManageGuildExpressions);
if (this.managed) return false;
const { permissions } = this.guild.members.me;
if (permissions.has(PermissionFlagsBits.ManageGuildExpressions)) return true;
return permissions.has(PermissionFlagsBits.CreateGuildExpressions) && this.author?.id === this.client.user.id;
}
/**