mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
Make audit log entries a collection (#1436)
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
const Collection = require('../util/Collection');
|
||||||
|
|
||||||
const Targets = {
|
const Targets = {
|
||||||
GUILD: 'GUILD',
|
GUILD: 'GUILD',
|
||||||
CHANNEL: 'CHANNEL',
|
CHANNEL: 'CHANNEL',
|
||||||
@@ -42,10 +44,13 @@ class GuildAuditLogs {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The entries for this guild's audit logs
|
* The entries for this guild's audit logs
|
||||||
* @type {GuildAuditLogsEntry[]}
|
* @type {Collection<Snowflake, GuildAuditLogsEntry>}
|
||||||
*/
|
*/
|
||||||
this.entries = [];
|
this.entries = new Collection();
|
||||||
for (const entry of data.audit_log_entries) this.entries.push(new GuildAuditLogsEntry(guild, entry));
|
for (const item of data.audit_log_entries) {
|
||||||
|
const entry = new GuildAuditLogsEntry(guild, item);
|
||||||
|
this.entries.set(entry.id, entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user