Skip to content

Commit

Permalink
Use Target variables for consistency (discordjs#1431)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek authored and amishshah committed Apr 29, 2017
1 parent c5e3826 commit eab2f34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/structures/GuildAuditLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@ class GuildAuditLogsEntry {
*/
this.id = data.id;

if (['USER', 'GUILD'].includes(targetType)) {
if ([Targets.USER, Targets.GUILD].includes(targetType)) {
/**
* 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);
} else if (targetType === 'WEBHOOK') {
} else if (targetType === Targets.WEBHOOK) {
this.target = guild.fetchWebhooks()
.then(hooks => {
this.target = hooks.find(h => h.id === data.target_id);
return this.target;
});
} else if (targetType === 'INVITE') {
} else if (targetType === Targets.INVITE) {
const change = this.changes.find(c => c.name === 'code');
this.target = guild.fetchInvites()
.then(invites => {
Expand Down

0 comments on commit eab2f34

Please sign in to comment.