mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 15:56:52 +02:00
24 lines
678 B
JavaScript
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}**...`);
|
|
}
|
|
};
|