mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
Use Target variables for consistency (#1431)
This commit is contained in:
@@ -164,19 +164,19 @@ class GuildAuditLogsEntry {
|
|||||||
*/
|
*/
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
|
||||||
if (['USER', 'GUILD'].includes(targetType)) {
|
if ([Targets.USER, Targets.GUILD].includes(targetType)) {
|
||||||
/**
|
/**
|
||||||
* Target of this entry
|
* Target of this entry
|
||||||
* @type {?Guild|User|Role|Emoji|Promise<Invite>|Promise<Webhook>}
|
* @type {?Guild|User|Role|Emoji|Invite|Webhook}
|
||||||
*/
|
*/
|
||||||
this.target = guild.client[`${targetType.toLowerCase()}s`].get(data.target_id);
|
this.target = guild.client[`${targetType.toLowerCase()}s`].get(data.target_id);
|
||||||
} else if (targetType === 'WEBHOOK') {
|
} else if (targetType === Targets.WEBHOOK) {
|
||||||
this.target = guild.fetchWebhooks()
|
this.target = guild.fetchWebhooks()
|
||||||
.then(hooks => {
|
.then(hooks => {
|
||||||
this.target = hooks.find(h => h.id === data.target_id);
|
this.target = hooks.find(h => h.id === data.target_id);
|
||||||
return this.target;
|
return this.target;
|
||||||
});
|
});
|
||||||
} else if (targetType === 'INVITE') {
|
} else if (targetType === Targets.INVITE) {
|
||||||
const change = this.changes.find(c => c.name === 'code');
|
const change = this.changes.find(c => c.name === 'code');
|
||||||
this.target = guild.fetchInvites()
|
this.target = guild.fetchInvites()
|
||||||
.then(invites => {
|
.then(invites => {
|
||||||
|
|||||||
Reference in New Issue
Block a user