1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 10:51:56 +00:00
musix-oss/commands/join.js
2020-03-14 18:38:02 +02:00

24 lines
874 B
JavaScript

module.exports = {
name: 'join',
alias: 'j',
usage: '',
description: 'Make Musix join the channel your channel',
onlyDev: true,
permission: 'none',
category: 'util',
async execute(msg, args, client, Discord, prefix, command) {
try {
const queue = client.queue.get(msg.guild.id);
const voiceChannel = msg.member.voice.channel;
const connection = await voiceChannel.join();
if (queue) {
queue.connection = connection;
}
msg.channel.send(`${client.messages.joined} ${voiceChannel.name}!`);
} catch (error) {
client.queue.delete(msg.guild.id);
client.channels.get(client.config.debug_channel).send(client.messages.errorConnecting + error);
return msg.channel.send(client.messages.error);
}
}
};