mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
19
src/cache.ts
19
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<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";
|
||||
|
||||
Reference in New Issue
Block a user