Leave Voice Channel Command

This commit is contained in:
Daniel Odendahl Jr
2018-03-24 16:05:02 +00:00
parent 9280c79300
commit 9383fa72e0
3 changed files with 24 additions and 2 deletions
+2 -1
View File
@@ -8,7 +8,7 @@ Xiao is a Discord bot coded in JavaScript with
300 commands, she is one of the most feature-filled bots out there, and formerly
served over 10,000 servers with a uniquely devoted fanbase.
## Commands (298)
## Commands (299)
### Utility:
* **prefix**: Shows or sets the command prefix.
@@ -212,6 +212,7 @@ served over 10,000 servers with a uniquely devoted fanbase.
* **airhorn**: Plays an airhorn sound in your voice channel.
* **dec-talk**: The world's best Text-to-Speech.
* **leave-voice-channel**: Leaves a voice channel, in case the bot gets stuck.
* **soundboard**: Plays a sound in your voice channel.
### Image Manipulation:
+21
View File
@@ -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}**.`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "70.4.0",
"version": "70.5.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {