From 37b1f38ebe0bff333cd979686a1e49977add8eac Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sun, 30 Apr 2017 15:25:22 -0500 Subject: [PATCH] Make audit log entries a collection (#1436) --- src/structures/GuildAuditLogs.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/structures/GuildAuditLogs.js b/src/structures/GuildAuditLogs.js index 477ac9e33..11a185daa 100644 --- a/src/structures/GuildAuditLogs.js +++ b/src/structures/GuildAuditLogs.js @@ -1,3 +1,5 @@ +const Collection = require('../util/Collection'); + const Targets = { GUILD: 'GUILD', CHANNEL: 'CHANNEL', @@ -42,10 +44,13 @@ class GuildAuditLogs { /** * The entries for this guild's audit logs - * @type {GuildAuditLogsEntry[]} + * @type {Collection} */ - this.entries = []; - for (const entry of data.audit_log_entries) this.entries.push(new GuildAuditLogsEntry(guild, entry)); + this.entries = new Collection(); + for (const item of data.audit_log_entries) { + const entry = new GuildAuditLogsEntry(guild, item); + this.entries.set(entry.id, entry); + } } /**