Files
discord-bot/commands/music/leave.js
T
2020-05-05 09:19:02 +01:00

27 lines
687 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class Leave extends Command {
constructor(client) {
super(client, {
name: 'leave',
memberName: 'leave',
group: 'music',
description: 'leaves a voice channel',
guildOnly: true,
throttling: {
usages: 1,
duration: 5
}
});
}
run = message => {
if (!message.member.voice.channel) return message.reply('you need to join a channel!');
const voiceChannel = message.member.voice.channel;
voiceChannel.leave();
return message.say('left!');
}
}