Merge pull request #1733 from TriForMine/patch-17

Fix (cache): types
This commit is contained in:
Skillz4Killz
2021-11-11 08:04:00 -05:00
committed by GitHub

View File

@@ -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<CachedUnavailableGuild>;
dispatchedGuildIds: AsyncCacheHandler<bigint>;
dispatchedChannelIds: AsyncCacheHandler<bigint>;
activeGuildIds: AsyncCacheHandler<bigint>;
executedSlashCommands: Set<string>;
fetchAllMembersProcessingRequests: Map<string, Function>;
execute: CacheExecutor;
@@ -272,4 +272,7 @@ export type TableNames =
| "presences"
| "threads"
| "unavailableGuilds"
| "members";
| "members"
| "dispatchedGuildIds"
| "dispatchedChannelIds"
| "activeGuildIds";