javascript - discord.js - bot timing out - Stack Overflow

I recently created a discord.js bot with node.js. However, I can't start my bot, because its timin

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
Add a ment  | 

2 Answers 2

Reset to default 4

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!

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745365772a4624571.html

相关推荐

  • javascript - discord.js - bot timing out - Stack Overflow

    I recently created a discord.js bot with node.js. However, I can't start my bot, because its timin

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信