mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 21:12:06 +00:00
Make audit log entries a collection (#1436)
This commit is contained in:
parent
c2566d230c
commit
37b1f38ebe
1 changed files with 8 additions and 3 deletions
|
|
@ -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<Snowflake, GuildAuditLogsEntry>}
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue