Reputation:
I recently created a discord.js bot with node.js. However, I can't start my bot, because its timing out.
Error: Something took too long to do.
at timeout.client.setTimeout (C:\Users\User\Desktop\tntbot\node_modules\discord.js\src\client\ClientManager.js:40:57)
at Timeout.setTimeout (C:\Users\User\Desktop\tntbot\node_modules\discord.js\src\client\Client.js:422:7)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
That's what I get on every start. I checked the code, it has no problem.
Please help.
Upvotes: 3
Views: 5314
Reputation: 255
My advice would be making a new project and redoing the npm install discord.js
because it looks like there's a problem in the node_modules
as it didn't download correctly.
One more thing to avoid errors that appear every now and then, add this line in your code after declaring the client/bot variable:
client.on('error' => console.log);
or
bot.on('error' => console.log);
This will log the error with its details to the console without actually terminating node.js. I hope I understood your question correctly, btw... this is my first answer to a user here :D
Upvotes: 0
Reputation:
Okay, I found the problem.
For some strange reasons, Discord generated a new token, and I used the old one.
Sorry for the misunderstanding.
Have a great day!
Upvotes: 4