diff --git a/README.md b/README.md index 4568673c..87b562c3 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/commands/voice/leave.js b/commands/voice/leave.js new file mode 100644 index 00000000..7c05cd8b --- /dev/null +++ b/commands/voice/leave.js @@ -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}**.`); + } +}; diff --git a/package.json b/package.json index ce3d868f..2730586e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "70.4.0", + "version": "70.5.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {