mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
this is not async anymore
This commit is contained in:
@@ -52,7 +52,7 @@ async function checkReady(payload: Ready, shardId: number, now: number) {
|
|||||||
if (Date.now() - now > 10000) {
|
if (Date.now() - now > 10000) {
|
||||||
eventHandlers.shardFailedToLoad?.(shardId, shard.unavailableGuildIds);
|
eventHandlers.shardFailedToLoad?.(shardId, shard.unavailableGuildIds);
|
||||||
// Force execute the loaded function to prevent infinite loop
|
// Force execute the loaded function to prevent infinite loop
|
||||||
await 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(async () => {
|
||||||
@@ -65,11 +65,11 @@ async function checkReady(payload: Ready, shardId: number, now: number) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// All guilds were loaded
|
// All guilds were loaded
|
||||||
await loaded(shardId);
|
loaded(shardId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loaded(shardId: number) {
|
function loaded(shardId: number) {
|
||||||
const shard = ws.shards.get(shardId);
|
const shard = ws.shards.get(shardId);
|
||||||
if (!shard) return;
|
if (!shard) return;
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ async function loaded(shardId: number) {
|
|||||||
"loop",
|
"loop",
|
||||||
`3. Running setTimeout in CHANNEL_DELTE file.`,
|
`3. Running setTimeout in CHANNEL_DELTE file.`,
|
||||||
);
|
);
|
||||||
await loaded(shardId);
|
loaded(shardId);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
cache.isReady = true;
|
cache.isReady = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user