mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 06:31:20 +00:00
Webpack build for branch master: b2ab947180
This commit is contained in:
parent
6c55685240
commit
35d385625b
2 changed files with 19 additions and 8 deletions
|
|
@ -16704,18 +16704,29 @@ class GuildAuditLogsEntry {
|
|||
* The target of this entry
|
||||
* @type {Snowflake|Guild|User|Role|Emoji|Invite|Webhook}
|
||||
*/
|
||||
this.target = data.target_id;
|
||||
this.target = this.changes.reduce((o, c) => {
|
||||
o[c.key] = c.new || c.old;
|
||||
return o;
|
||||
}, {});
|
||||
this.target.id = data.target_id;
|
||||
} else if ([Targets.USER, Targets.GUILD].includes(targetType)) {
|
||||
this.target = guild.client[`${targetType.toLowerCase()}s`].get(data.target_id);
|
||||
} else if (targetType === Targets.WEBHOOK) {
|
||||
this.target = this.webhooks.get(data.target_id);
|
||||
} else if (targetType === Targets.INVITE) {
|
||||
const change = this.changes.find(c => c.key === 'code');
|
||||
this.target = guild.fetchInvites()
|
||||
.then(invites => {
|
||||
this.target = invites.find(i => i.code === (change.new_value || change.old_value));
|
||||
return this.target;
|
||||
});
|
||||
if (guild.me.permissions.has('MANAGE_GUILD')) {
|
||||
const change = this.changes.find(c => c.key === 'code');
|
||||
this.target = guild.fetchInvites()
|
||||
.then(invites => {
|
||||
this.target = invites.find(i => i.code === (change.new || change.old));
|
||||
return this.target;
|
||||
});
|
||||
} else {
|
||||
this.target = this.changes.reduce((o, c) => {
|
||||
o[c.key] = c.new || c.old;
|
||||
return o;
|
||||
}, {});
|
||||
}
|
||||
} else if (targetType === Targets.MESSAGE) {
|
||||
this.target = guild.client.users.get(data.target_id);
|
||||
} else {
|
||||
|
|
|
|||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue