How Can I make the bot leave a channel without having the connection that was created on his join ?
When the bot joins a channel it creates a connection with the joinVoiceChannel() function but when we reset the bot the voiceConnection is not kept so my question is how can I get the connection of the bot in a channel without having the first connection object ? My goal is to make him leave the channel.
4 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!
- ✅
Marked as resolved by OP[email protected]
node version v20.12.0
@discordjs/[email protected]
I know that the code is not really good for now, I m working on it, I just want to know how to kick himfrom the channel
:method: VoiceState#setChannel()
Moves the member to a different channel, or disconnects them from the one they're in.
Thanks !
I ll try this
Wait, the bot need to have the permission to kick members from the voice channel to disconnect himself ?
I mean the "Move Members" permission
Well maybe I m doing something wrong
Channel is a valid channel
and I tried for setChannel too
same error
Missing Permissions
Ohh interesting, I'll try that, thanks again