more things

This commit is contained in:
ITOH
2021-05-05 18:09:39 +02:00
parent 4533e6356b
commit 7e37a90bb9
2 changed files with 6 additions and 5 deletions
+5 -5
View File
@@ -32,18 +32,18 @@ export function handleReady(
); );
// Start ready check in 2 seconds // Start ready check in 2 seconds
setTimeout(async () => { setTimeout(() => {
eventHandlers.debug?.( eventHandlers.debug?.(
"loop", "loop",
`1. Running setTimeout in READY file.`, `1. Running setTimeout in READY file.`,
); );
await checkReady(payload, shardId, now); checkReady(payload, shardId, now);
}, 2000); }, 2000);
} }
// Don't pass the shard itself because unavailableGuilds won't be updated by the GUILD_CREATE event // Don't pass the shard itself because unavailableGuilds won't be updated by the GUILD_CREATE event
/** This function checks if the shard is fully loaded */ /** This function checks if the shard is fully loaded */
async function checkReady(payload: Ready, shardId: number, now: number) { function checkReady(payload: Ready, shardId: number, now: number) {
const shard = ws.shards.get(shardId); const shard = ws.shards.get(shardId);
if (!shard) return; if (!shard) return;
@@ -55,12 +55,12 @@ async function checkReady(payload: Ready, shardId: number, now: number) {
loaded(shardId); loaded(shardId);
} else { } else {
// Not all guilds were loaded but 10 seconds haven't passed so check again // Not all guilds were loaded but 10 seconds haven't passed so check again
setTimeout(async () => { setTimeout(() => {
eventHandlers.debug?.( eventHandlers.debug?.(
"loop", "loop",
`2. Running setTimeout in READY file.`, `2. Running setTimeout in READY file.`,
); );
await checkReady(payload, shardId, now); checkReady(payload, shardId, now);
}, 2000); }, 2000);
} }
} else { } else {
+1
View File
@@ -10,6 +10,7 @@ const guildMemberQueue = new Map<
let processingQueue = false; let processingQueue = false;
/** Cache all guild members without need to worry about overwriting something. */ /** Cache all guild members without need to worry about overwriting something. */
// deno-lint-ignore require-await
export async function cacheMembers( export async function cacheMembers(
guildId: bigint, guildId: bigint,
members: GuildMemberWithUser[], members: GuildMemberWithUser[],