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.
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.
Share Improve this question edited Mar 2, 2018 at 18:40 André 4,4974 gold badges33 silver badges58 bronze badges asked Aug 21, 2017 at 12:34 user8010449user8010449 2-
Maybe you have a connection problem. May be a proxy blocking it. Can you add a small
hello world
-ish code that reproduce the bug ? – Seblor Commented Aug 21, 2017 at 12:40 - Thanks, I tried that, and I found the problem. – user8010449 Commented Aug 21, 2017 at 13:05
2 Answers
Reset to default 4Okay, 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!
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