TerrorByte
DIAdiscord.js - Imagine an app
•Created by TerrorByte on 11/25/2023 in #djs-questions
Receiving "ShardingReadyTimeout" even though ready event is firing
Alright, thank you very much. I'll figure out a way to only remove events created by me and not the client. Much appreciated!
12 replies
DIAdiscord.js - Imagine an app
•Created by TerrorByte on 11/25/2023 in #djs-questions
Receiving "ShardingReadyTimeout" even though ready event is firing
Awesome, good to know. I'm assuming this method should be considered unsafe then and not used? At least, not during startup
12 replies
DIAdiscord.js - Imagine an app
•Created by TerrorByte on 11/25/2023 in #djs-questions
Receiving "ShardingReadyTimeout" even though ready event is firing
Hmm, oddly enough I don't, even after enabling all my bot's features again. Thinking through it, is that call removing the
ready
event from the client, therefore preventing it from being fired upon initial construction?12 replies
DIAdiscord.js - Imagine an app
•Created by TerrorByte on 11/25/2023 in #djs-questions
Receiving "ShardingReadyTimeout" even though ready event is firing
Let me give that a shot, I'll report back in a sec
12 replies
DIAdiscord.js - Imagine an app
•Created by TerrorByte on 11/25/2023 in #djs-questions
Receiving "ShardingReadyTimeout" even though ready event is firing
TL;DR
1) Sharding manager spawns a shard
2) The shard creates a client of type CrystalClient, which extends Client
3) The CrystalClient constructor calls the loadEvents method, which A) iterates over all files and filters the files by .js extensions and B) attaches them to the client object using
client[event.once ? "once" : "on"](event.name, execute)
, where event.once
and execute
is a property on the imported Event
and execute
is defined as
The whole event loading process is completed after approx. 55.416ms according to the last run of my bot
4) One of those events that is loaded is the client's ready
event, which fires fine
5) However, after about 30 seconds the bot times out anyway
6) If void loadEvents()
is replaced with this.on("ready", () => { console.log("ready") })
within the constructor of CrystalClient
, no errors occur, leading me to believe it's something to do with the file loading process. However, again, the ready event is still being thrown as indicated by hardcoded console.log()
methods within the ready event file itself12 replies
DIAdiscord.js - Imagine an app
•Created by TerrorByte on 11/25/2023 in #djs-questions
Receiving "ShardingReadyTimeout" even though ready event is firing
npm list discord.js && node -v
:
I know there's a lot there, I can break it down if needed but basically, ready event is being fired, but shard is still timing out and idk why12 replies
DIAdiscord.js - Imagine an app
•Created by TerrorByte on 11/25/2023 in #djs-questions
Receiving "ShardingReadyTimeout" even though ready event is firing
I reached a character limit, so here's the rest of the info:
Here is my eventHandler class, which contains the loadEvents method:
The
loadFiles()
function is defined as
If I change the void loadEvents(CrystalClient.client)
line to a standard this.on("ready", () => { console.log("ready") })
method, it works. But when I'm loading events dynamically from an event file, it freaks out.
For reference, this event is being registered fine
But the error still fires
12 replies