diff --git a/src/cache.ts b/src/cache.ts index 8ef91e4e6..3cdd49215 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -82,17 +82,16 @@ 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 () { + 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; @@ -154,6 +153,7 @@ export interface AsyncCache { unavailableGuilds: AsyncCacheHandler; dispatchedGuildIds: AsyncCacheHandler; dispatchedChannelIds: AsyncCacheHandler; + activeGuildIds: AsyncCacheHandler; executedSlashCommands: Set; fetchAllMembersProcessingRequests: Map; execute: CacheExecutor; @@ -272,4 +272,7 @@ export type TableNames = | "presences" | "threads" | "unavailableGuilds" - | "members"; + | "members" + | "dispatchedGuildIds" + | "dispatchedChannelIds" + | "activeGuildIds";