fix(GuildAuditLogs): Cache guild scheduled events (#7951)

This commit is contained in:
Jiralite
2022-06-04 08:04:08 +01:00
committed by GitHub
parent db81127886
commit 2f03f9ad3f
2 changed files with 12 additions and 0 deletions

View File

@@ -55,6 +55,17 @@ class GuildAuditLogs {
}
}
/**
* Cached {@link GuildScheduledEvent}s.
* @type {Collection<Snowflake, GuildScheduledEvent>}
* @private
*/
this.guildScheduledEvents = data.guild_scheduled_events.reduce(
(guildScheduledEvents, guildScheduledEvent) =>
guildScheduledEvents.set(guildScheduledEvent.id, guild.scheduledEvents._add(guildScheduledEvent)),
new Collection(),
);
/**
* The entries for this guild's audit logs
* @type {Collection<Snowflake, GuildAuditLogsEntry>}

View File

@@ -1155,6 +1155,7 @@ export class GuildAuditLogs<T extends GuildAuditLogsResolvable = null> {
private constructor(guild: Guild, data: RawGuildAuditLogData);
private webhooks: Collection<Snowflake, Webhook>;
private integrations: Collection<Snowflake | string, Integration>;
private guildScheduledEvents: Collection<Snowflake, GuildScheduledEvent>;
public entries: Collection<Snowflake, GuildAuditLogsEntry<T>>;
public static Entry: typeof GuildAuditLogsEntry;
public toJSON(): unknown;