[RESOLVED] Another discord.js DiscordAPIError?


#1

So yeah, just starting my bot, and then this happens.

[ERROR] (node:5606) UnhandledPromiseRejectionWarning: DiscordAPIError

    at ClientManager.connectToWebSocket (/rbd/pnpm-volume/e465299b-d3b0-41a0-8d8a-587bdce5a220/node_modules/.github.com/discordjs/discord.js/8a6d029c006b5a107363d3787ff60bcccda2a984/node_modules/discord.js/src/client/ClientManager.js:42:29)

    at Promise (/rbd/pnpm-volume/e465299b-d3b0-41a0-8d8a-587bdce5a220/node_modules/.github.com/discordjs/discord.js/8a6d029c006b5a107363d3787ff60bcccda2a984/node_modules/discord.js/src/client/Client.js:238:20)

    at new Promise (<anonymous>)

    at Client.login (/rbd/pnpm-volume/e465299b-d3b0-41a0-8d8a-587bdce5a220/node_modules/.github.com/discordjs/discord.js/8a6d029c006b5a107363d3787ff60bcccda2a984/node_modules/discord.js/src/client/Client.js:235:12)

I’ve seen a lot other ones, so could anyone please help me? Thanks.


#2

If you add a catch to handle the DiscrodAPIError then you should get a more complete error message, giving us more to work with. Thanks.


#3

Ah, thank you. I’ll do that now!

EDIT:
@Gareth

DiscordAPIError
at ClientManager.connectToWebSocket (/rbd/pnpm-volume/e465299b-d3b0-41a0-8d8a-587bdce5a220/node_modules/.github.com/discordjs/discord.js/8a6d029c006b5a107363d3787ff60bcccda2a984/node_modules/discord.js/src/client/ClientManager.js:42:29)
at Promise (/rbd/pnpm-volume/e465299b-d3b0-41a0-8d8a-587bdce5a220/node_modules/.github.com/discordjs/discord.js/8a6d029c006b5a107363d3787ff60bcccda2a984/node_modules/discord.js/src/client/Client.js:238:20)
at new Promise (&lt;anonymous&gt;)
at Client.login (/rbd/pnpm-volume/e465299b-d3b0-41a0-8d8a-587bdce5a220/node_modules/.github.com/discordjs/discord.js/8a6d029c006b5a107363d3787ff60bcccda2a984/node_modules/discord.js/src/client/Client.js:235:12)
at Object.&lt;anonymous&gt; (/app/bot.js:478:8)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)

#4

Oh and also, my friend, Jonas, has the same issue.
I believe his project is https://9106184.glitch.me/
Thanks.


#5

Thanks, but I need the full error message including the section before the DiscordAPIError part. It’s perhaps easiest if you let us know the project name and we can take a look. If your project is private, either make it public temporarily or DM me a join link so we can view the code. Thanks.


#6

Sure thing.
Sent it to you now.


#7

I couldn’t see any errors in the logs, it seemed to be working fine. When does the error occur?


#8

Let me restart it for you, it should appear now. @Gareth


#9

I don’t understand the cause of the error, but it’s specific to the development version of discord.js you’re using so I’d flag it to their development team.


#10

@Gareth, this started happening after people complained about the IP ban.


#11

Ok, we’ll test for that but it’s not the typical error message you get for a banned IP. But perhaps the library isn’t handling it correctly. Will get back to you.


#12

We’ve moved the project on to a new host, along with your friend’s app too. Both should now be working.


#13

Working now!
Thanks a lot! :smile: