VPS turns off after discord bot didnt get permissions to send messages in a server.
im getting this error :
this is my error handling code :
is my bot going offline after permissions error my VPS fault or discord.js's fault??
i am so confused
i just want it to log it in console or the channel that it is missing permissions and continue working and not going offline instantly.
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!You can also check the permissions Member (including the bot) has for a channel to try and avoid this happening, and alert yourself in other ways; such as if you start sending messages to servers.
i removed the code and it didnt change anything it still made the bot go offline
no my main question is if its possible for the bot to stop going offline when it has any errors like this
It might be possible with some form of global listener...but even if it is, it'd be my recommendation to defensivly code and account for the perms being missing.
If you ignore all errors through a global catcher, you'll end up not knowing when things stop working.
sorry my english a bit off what do you mean by defensively coding and account for the perms?
So instead of catching all errors, try and avoid them.
Check if the Bot has perms, don't just catch if it doesn't