Skip to content
Advertisement

My bot can’t take errors when failling to run a “join” voice channel command

I’m currently coding a discord.js bot and I made this join command so the bot can join my voice channel

JavaScript

The problem is that I have no idea how to make it so that if the last function gets an error or doesn’t work at all It can send an error message to the user like @User, I could not join the channel, "THE ERROR" :/ I don’t want my bot to crash and having to run it again just because of one small detail. Is there a way to fix it? It would help me a lot! Thanks in advance!

Advertisement

Answer

I would not let the user know about the error, because it might just confuse them, but you can do try catch to check if it goes through and if not message is sent.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement