Open Toyuuu opened 3 years ago
Instead of leaving the vc and then joining other vc, move the bot its more efficient.
Can you help me? I've got this so far:
const util = require("../util");
var arr = [] module.exports = { name: "join", aliases: ["j"], exec: async (msg) => { const { music } = msg.guild; if (!msg.member.voice.channel) return msg.channel.send(
:x: You need to be in a voice channel to run this command!
); if (msg.guild.me.voice.channel && !msg.guild.me.voice.channel.equals(msg.member.voice.channel)) return msg.channel.send(:thumbsup: **I've left** ${msg.guild.me.voice.channel} **and joining** ${msg.member.voice.channel}!
); await music.leave(msg.guild); await music.join(msg.member.voice.channel); const missingPerms = util.missingPerms(msg.guild.me.permissionsIn(msg.member.voice.channel), ["CONNECT", "SPEAK"]); if ((!music.player || !music.player.playing) && missingPerms.length) return msg.channel.send(Hmm :thinking: I am unable to join you're voice chat! I am missing the permission: ${missingPerms.map(x => ``${x}``).join(", ")}. Do I have access to this voice chat?
); else { await music.join(msg.member.voice.channel); }}
}
How do I make it leave voice channel? I got it to join just not leave to move channel.
ctx.guild.members.cache.get(ctx.client.user.id).voice.setChannel(ctx.member.voice.channel)
use this to move channel instead bruh
Can you help me? I've got this so far:
const util = require("../util");
var arr = [] module.exports = { name: "join", aliases: ["j"], exec: async (msg) => { const { music } = msg.guild; if (!msg.member.voice.channel) return msg.channel.send(
:x: You need to be in a voice channel to run this command!
); if (msg.guild.me.voice.channel && !msg.guild.me.voice.channel.equals(msg.member.voice.channel)) return msg.channel.send(:thumbsup: **I've left** ${msg.guild.me.voice.channel} **and joining** ${msg.member.voice.channel}!
); await music.leave(msg.guild); await music.join(msg.member.voice.channel); const missingPerms = util.missingPerms(msg.guild.me.permissionsIn(msg.member.voice.channel), ["CONNECT", "SPEAK"]); if ((!music.player || !music.player.playing) && missingPerms.length) return msg.channel.send(Hmm :thinking: I am unable to join you're voice chat! I am missing the permission: ${missingPerms.map(x =>
`${x}`).join(", ")}. Do I have access to this voice chat?
); else { await music.join(msg.member.voice.channel); }}
How do I make it leave voice channel? I got it to join just not leave to move channel.