From 5f3fc170fbfd49fa4f117901578c309f00f65d0b Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Mon, 28 Apr 2025 07:46:03 +0200 Subject: [PATCH] fix(SoundboardSound): wrong emoji comparison in `equals` (#10861) --- packages/discord.js/src/structures/GuildAuditLogsEntry.js | 1 - packages/discord.js/src/structures/SoundboardSound.js | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/discord.js/src/structures/GuildAuditLogsEntry.js b/packages/discord.js/src/structures/GuildAuditLogsEntry.js index 2f72eabc0..ab2a0a87a 100644 --- a/packages/discord.js/src/structures/GuildAuditLogsEntry.js +++ b/packages/discord.js/src/structures/GuildAuditLogsEntry.js @@ -487,7 +487,6 @@ class GuildAuditLogsEntry { AuditLogEvent.ThreadUpdate, AuditLogEvent.SoundboardSoundUpdate, AuditLogEvent.ApplicationCommandPermissionUpdate, - AuditLogEvent.SoundboardSoundUpdate, AuditLogEvent.AutoModerationRuleUpdate, AuditLogEvent.AutoModerationBlockMessage, AuditLogEvent.AutoModerationFlagToChannel, diff --git a/packages/discord.js/src/structures/SoundboardSound.js b/packages/discord.js/src/structures/SoundboardSound.js index f05e3a193..887b6b822 100644 --- a/packages/discord.js/src/structures/SoundboardSound.js +++ b/packages/discord.js/src/structures/SoundboardSound.js @@ -181,8 +181,8 @@ class SoundboardSound extends Base { this.available === other.available && this.name === other.name && this.volume === other.volume && - this.emojiId === other.emojiId && - this.emojiName === other.emojiName && + this._emoji?.id === other._emoji?.id && + this._emoji?.name === other._emoji?.name && this.guildId === other.guildId && this.user?.id === other.user?.id ); @@ -193,8 +193,8 @@ class SoundboardSound extends Base { this.available === other.available && this.name === other.name && this.volume === other.volume && - this.emojiId === other.emoji_id && - this.emojiName === other.emoji_name && + (this._emoji?.id ?? null) === other.emoji_id && + (this._emoji?.name ?? null) === other.emoji_name && this.guildId === other.guild_id && this.user?.id === other.user?.id );