mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
fix(GuildAuditLogsEntry): default to object with id for deleted targets (#3373)
This commit is contained in:
@@ -148,6 +148,7 @@ class GuildAuditLogs {
|
||||
* * An emoji
|
||||
* * An invite
|
||||
* * A webhook
|
||||
* * An object with an id key if target was deleted
|
||||
* * An object where the keys represent either the new value or the old value
|
||||
* @typedef {?Object|Guild|User|Role|Emoji|Invite|Webhook} AuditLogEntryTarget
|
||||
*/
|
||||
@@ -341,7 +342,7 @@ class GuildAuditLogsEntry {
|
||||
} else if (targetType === Targets.MESSAGE) {
|
||||
this.target = guild.client.users.get(data.target_id);
|
||||
} else {
|
||||
this.target = guild[`${targetType.toLowerCase()}s`].get(data.target_id);
|
||||
this.target = guild[`${targetType.toLowerCase()}s`].get(data.target_id) || { id: data.target_id };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user