mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
more things
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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[],
|
||||||
|
|||||||
Reference in New Issue
Block a user