Answers for "Bot leaves the channel inactivity discord.js"

0

Bot leaves the channel inactivity discord.js

// Assuming 'message' is the message with the command
let { channelID } = message.member.voice // Get the user's voice channel ID
if (channelID) {
  // Find an existing connection to that channel
  let connection = client.voice.connections.find(conn => conn.channel.id == channelID)
  if (connection) // If you find one, use .disconnect()
    connection.disconnect()
}
Posted by: Guest on April-26-2021

Browse Popular Code Answers by Language