From 073de2b97f767b5ff4003de732bcc1791ce4d1e6 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Sat, 18 Dec 2021 13:28:59 +0700 Subject: [PATCH 1/5] #1828 --- src/types/auditLog/auditLog.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/types/auditLog/auditLog.ts b/src/types/auditLog/auditLog.ts index 5e7b5cb40..39dac4957 100644 --- a/src/types/auditLog/auditLog.ts +++ b/src/types/auditLog/auditLog.ts @@ -3,6 +3,7 @@ import { Integration } from "../integrations/integration.ts"; import { User } from "../users/user.ts"; import { Webhook } from "../webhooks/webhook.ts"; import { AuditLogEntry } from "./auditLogEntry.ts"; +import { ScheduledEvent } from "../guilds/scheduledEvents.ts"; /** https://discord.com/developers/docs/resources/audit-log#audit-log-object */ export interface AuditLog { @@ -16,4 +17,6 @@ export interface AuditLog { integrations: Partial[]; /** List of threads found in the audit log. */ threads: Channel[]; + /** List of guild scheduled events found in the audit log */ + scheduledEvents: ScheduledEvent[]; } From 662c82a27e81816fc1d579af2ff8e63a19de6f3f Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Tue, 21 Dec 2021 08:13:05 +0700 Subject: [PATCH 2/5] add threads and sheduledEvenets to return of getAuditLog --- src/helpers/guilds/getAuditLogs.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/guilds/getAuditLogs.ts b/src/helpers/guilds/getAuditLogs.ts index ed4788956..d1ee34f13 100644 --- a/src/helpers/guilds/getAuditLogs.ts +++ b/src/helpers/guilds/getAuditLogs.ts @@ -48,5 +48,7 @@ export async function getAuditLogs(bot: Bot, guildId: bigint, options?: GetGuild } : undefined, })), + threads: auditlog.threads.map((thread) => bot.transformers.channel(bot, { channel: thread, guildId })), + scheduledEvents: auditlog.scheduled_events.map((event) => bot.transformers.scheduledEvent(bot, event)), }; } From af6a27de16fb26e7821dc0e7cab87c5c010ba7cb Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Tue, 21 Dec 2021 08:50:36 +0700 Subject: [PATCH 3/5] Fix GatewayOpcodes.StatusUpdate (renamed to PresenceUpdate) --- src/helpers/misc/editBotStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/misc/editBotStatus.ts b/src/helpers/misc/editBotStatus.ts index cd2bcb9f5..b2c38fb12 100644 --- a/src/helpers/misc/editBotStatus.ts +++ b/src/helpers/misc/editBotStatus.ts @@ -7,7 +7,7 @@ export function editBotStatus(bot: Bot, data: Omit Date: Tue, 21 Dec 2021 08:51:50 +0700 Subject: [PATCH 4/5] memoryBenchmarks() second argument is optional (defaults to true) --- tests/benchmark.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/benchmark.ts b/tests/benchmark.ts index 090122742..37fb2b889 100644 --- a/tests/benchmark.ts +++ b/tests/benchmark.ts @@ -5,10 +5,7 @@ import { sanitizeMode } from "./constants.ts"; Deno.test({ name: "[Memory] Benchmark memory tests", fn: async (t) => { - await memoryBenchmarks(bot, { - log: true, - table: true, - }); + await memoryBenchmarks(bot); }, ...sanitizeMode, }); From 1e89abba6c4200a67eaa9bc17f8edfe00d13e2bc Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Tue, 21 Dec 2021 09:03:31 +0700 Subject: [PATCH 5/5] Revert "memoryBenchmarks() second argument is optional (defaults to true)" This reverts commit b773ef1571e41c3130a1ac0270b33b3976a3b9d6. --- tests/benchmark.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/benchmark.ts b/tests/benchmark.ts index 37fb2b889..090122742 100644 --- a/tests/benchmark.ts +++ b/tests/benchmark.ts @@ -5,7 +5,10 @@ import { sanitizeMode } from "./constants.ts"; Deno.test({ name: "[Memory] Benchmark memory tests", fn: async (t) => { - await memoryBenchmarks(bot); + await memoryBenchmarks(bot, { + log: true, + table: true, + }); }, ...sanitizeMode, });