discord.js
discord.js copied to clipboard
AuditLogEvent.SoundboardSoundCreate / SoundboardSoundUpdate / SoundboardSoundDelete event returns targetId = null instead of the created sound’s ID
Which package is this bug report for?
discord.js
Issue description
When listening to AuditLogEvent.SoundboardSoundCreate, SoundboardSoundUpdate, SoundboardSoundDelete, the GuildAuditLogsEntry object always returns targetId = null.
For all other audit log types such as emoji, channel, role, sticker, etc., targetId correctly contains the created object’s ID. But for Soundboard Sound Create, targetId is always null, even though Discord provides the ID inside changes.
Because of this, developers have to manually extract the ID from the changes array instead of using entry.targetId, which breaks consistency with all other audit log events.
Code sample
const client = new Client(...)
client.on(Events.GuildAuditLogEntryCreate,(entry) => {
if (entry.action == AuditLogEvent.SoundboardSoundCreate) {
const { targetId, changes } = entry;
console.log(targetId); // null
console.log(changes.find((change) => change.key == 'id').new); // 12345678912..
};
});
Versions
[email protected] node 10.9.2 MacOS 26
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
SoundboardSound
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response