Closed ItzDerock closed 2 years ago
I understand the intentions behind this issue, but I really don't think it's the library's place to validate that it is being used correctly. If you get similar errors in future, I'd recommend debugging the variables that you're passing to the library and making sure they look correct. Also looking at documentation/typings to see what parameters and names are expected.
Is your feature request related to a problem? Please describe. I spent over an hour trying to figure out why some code I updated to v13 wasn't working, and it turns out it was because
VoiceState.channelID
was removed fromdiscord.js@dev
. I had that passed into thechannelId
option in joinVoiceChannel. There was no error saying that the channel was null, instead my bot would disconnect from Discord and reconnect, and the only error that appears is that it didn't enter ready state in time. To find the error I had to enable debug messages on my Discord client and only then did I seeUnknown opcode.
. That still wasn't enough for me to figure it out and so I added a console.log to the payload variable defined in the createVoiceConnection function, and only after I saw that did I see thatchannel_id
was undefined.Describe the ideal solution Add some sort of error. Like "Expected string for channelId, but got undefined"
Describe alternatives you've considered An alternative would be to have everyone switch to typescript so this error doesn't go unnoticed, as their ide is going to scream at them and so is the typescript compiler.
Additional context nothing