Files
xiao/commands/voice/leave.js
T
2020-05-05 17:13:10 -04:00

24 lines
678 B
JavaScript

const Command = require('../../structures/Command');
module.exports = class LeaveCommand extends Command {
constructor(client) {
super(client, {
name: 'leave',
aliases: ['leave-voice-channel', 'leave-vc', 'leave-voice', 'leave-channel'],
group: 'voice',
memberName: 'leave',
description: 'Leaves the current voice channel.',
guildOnly: true,
guarded: true,
userPermissions: ['MOVE_MEMBERS']
});
}
run(msg) {
const connection = this.client.voice.connections.get(msg.guild.id);
if (!connection) return msg.reply('I am not in a voice channel.');
connection.channel.leave();
return msg.reply(`Left **${connection.channel.name}**...`);
}
};