I am currently working on my first discord.js bot. I wanted to make a command where the bot disconnects all members from the voice channel. Is there any way I can do that?
You can loop through every member in a voice channel using Collection.each()
and VoiceState.kick()
// iterate a function through every member in a voice chat
<VoiceChannel>.members.each((member) => {
member.voice.kick() // kick the member
};
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.