2020-02-05 20:02:53 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'join',
|
|
|
|
alias: 'j',
|
2020-02-24 18:41:40 +00:00
|
|
|
usage: '',
|
2020-02-05 20:02:53 +00:00
|
|
|
description: 'Make Musix join the channel your channel',
|
2020-02-10 19:04:42 +00:00
|
|
|
onlyDev: true,
|
2020-02-05 20:02:53 +00:00
|
|
|
permission: 'none',
|
|
|
|
category: 'util',
|
|
|
|
async execute(msg, args, client, Discord, prefix) {
|
|
|
|
try {
|
|
|
|
const serverQueue = client.queue.get(msg.guild.id);
|
|
|
|
const voiceChannel = msg.member.voice.channel;
|
|
|
|
const connection = await voiceChannel.join();
|
|
|
|
if (serverQueue) {
|
|
|
|
serverQueue.connection = connection;
|
|
|
|
}
|
|
|
|
msg.channel.send(`<:green_check_mark:674265384777416705> Joined ${voiceChannel.name}!`);
|
|
|
|
} catch (error) {
|
|
|
|
client.queue.delete(msg.guild.id);
|
|
|
|
client.channels.get(client.config.debug_channel).send("Error with connecting to voice channel: " + error);
|
|
|
|
return msg.channel.send(`<:redx:674263474704220182> An error occured: ${error}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|