Does anyone know the most updated method for creating a discord js bot that can move users to different voice channels? I've been encountering errors with the solutions I found online. Currently, I'm manually setting it to a specific channel for testing purposes, but it's not functioning as expected.
client.on('message', message => {
console.log('' + message.author + ': ' + message.content);
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(" ");
const c = args;
for(var i = 0; i < c.length; i++) {
c[i] = c[i].toLowerCase();
}
if (c[0] === 'movevoice'){
if(!message.mentions.members.first()){
message.author.voice.setChannel(762760164364648479)
}else{
const member = message.mentions.members.first();
member.voice.setChannel(762760164364648479);
}
}