mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 10:19:11 +02:00
Leave Voice Channel Command
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class LeaveVoiceChannelCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'leave-voice-channel',
|
||||
aliases: ['leave-vc'],
|
||||
group: 'voice',
|
||||
memberName: 'leave',
|
||||
description: 'Leaves a voice channel, in case the bot gets stuck.',
|
||||
guildOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
if (!this.client.voiceConnections.has(msg.guild.id)) return msg.reply('I am not in a voice channel...');
|
||||
const { channel } = this.client.voiceConnections.get(msg.guild.id);
|
||||
channel.leave();
|
||||
return msg.say(`Left **${channel.name}**.`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user