From fd313fbb774036ceb3820e35fae159bd96f4d041 Mon Sep 17 00:00:00 2001 From: TriForMine Date: Thu, 11 Nov 2021 12:54:54 +0100 Subject: [PATCH 1/4] Fix (cache): types --- src/cache.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cache.ts b/src/cache.ts index 8ef91e4e6..3f8baa146 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -87,12 +87,11 @@ export function createCache( activeGuildIds: new Set(), executedSlashCommands: new Set(), fetchAllMembersProcessingRequests: new Map(), + execute: async function () { + throw new Error("Async Cache requires a custom execute function to be implemented."); + } } as AsyncCache; - cache.execute = async function () { - throw new Error("Async Cache requires a custom execute function to be implemented."); - }; - return cache; } if (!options.tableCreator) options.tableCreator = createTable; From 4946e62780ee92ab139ec76f990b717e24e96041 Mon Sep 17 00:00:00 2001 From: TriForMine Date: Thu, 11 Nov 2021 11:55:29 +0000 Subject: [PATCH 2/4] change: prettier code --- src/cache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache.ts b/src/cache.ts index 3f8baa146..d29b45a3f 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -89,7 +89,7 @@ export function createCache( fetchAllMembersProcessingRequests: new Map(), execute: async function () { throw new Error("Async Cache requires a custom execute function to be implemented."); - } + }, } as AsyncCache; return cache; From 2797e3176de124ae5f40ecf2752453803953bafc Mon Sep 17 00:00:00 2001 From: TriForMine Date: Thu, 11 Nov 2021 12:59:14 +0100 Subject: [PATCH 3/4] Update cache.ts --- src/cache.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cache.ts b/src/cache.ts index d29b45a3f..91aad38b6 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -82,9 +82,9 @@ export function createCache( presences: options.tableCreator(bot, "presences"), // threads: options.tableCreator(bot, "threads"), unavailableGuilds: options.tableCreator(bot, "unavailableGuilds"), - dispatchedGuildIds: new Set(), - dispatchedChannelIds: new Set(), - activeGuildIds: new Set(), + dispatchedGuildIds: options.tableCreator(bot, "dispatchedGuildIds"), + dispatchedChannelIds: options.tableCreator(bot, "dispatchedChannelIds"), + activeGuildIds: options.tableCreator(bot, "activeGuildIds"), executedSlashCommands: new Set(), fetchAllMembersProcessingRequests: new Map(), execute: async function () { @@ -153,6 +153,7 @@ export interface AsyncCache { unavailableGuilds: AsyncCacheHandler; dispatchedGuildIds: AsyncCacheHandler; dispatchedChannelIds: AsyncCacheHandler; + activeGuildIds: AsyncCacheHandler; executedSlashCommands: Set; fetchAllMembersProcessingRequests: Map; execute: CacheExecutor; From 6d63195beaaf3673fb80d47d2c7f599c485be535 Mon Sep 17 00:00:00 2001 From: TriForMine Date: Thu, 11 Nov 2021 13:00:44 +0100 Subject: [PATCH 4/4] Update cache.ts --- src/cache.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cache.ts b/src/cache.ts index 91aad38b6..3cdd49215 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -272,4 +272,7 @@ export type TableNames = | "presences" | "threads" | "unavailableGuilds" - | "members"; + | "members" + | "dispatchedGuildIds" + | "dispatchedChannelIds" + | "activeGuildIds";