aboutsummaryrefslogtreecommitdiff
path: root/commands/leave.js
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-06-24 22:36:58 -0400
committerAlee <alee14498@gmail.com>2018-06-24 22:36:58 -0400
commit2783ab5634b54492c2d487d11bcacad767f57833 (patch)
treefc5f0b314e0d0be5eb7535dd2f4701efaef5b874 /commands/leave.js
parent1abdcfe8c1ec71b8a432f36fc60555431c2a247d (diff)
downloadAleeBot-2783ab5634b54492c2d487d11bcacad767f57833.tar.gz
AleeBot-2783ab5634b54492c2d487d11bcacad767f57833.tar.bz2
AleeBot-2783ab5634b54492c2d487d11bcacad767f57833.zip
Added music back (finally) and changed from 2.10.1 to 2.11.0 Beta
Diffstat (limited to 'commands/leave.js')
-rw-r--r--commands/leave.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/commands/leave.js b/commands/leave.js
index 9a54555..a2a48d8 100644
--- a/commands/leave.js
+++ b/commands/leave.js
@@ -1,7 +1,7 @@
/****************************************
*
* Leave: Command for AleeBot
- * Copyright (C) 2018 AleeCorp
+ * Copyright (C) 2018 AleeCorp & (your name here)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,10 +17,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* *************************************/
-module.exports.run = async (client, message) => {
- if (!['242775871059001344', message.guild.owner.user.id].includes(message.author.id)) return message.reply('Nope! You need the person who created this bot or the owner of this guild to use this command.');
- message.channel.send('Alright, I\'m leaving the server now. Bye everyone!')
- message.guild.leave();
+
+module.exports.run = async (client, message, args) => {
+ if (!message.member.voiceChannel) return message.reply('You need a voice channel to perform this action.');
+
+ if (!message.guild.me.voiceChannel) return message.reply('Error: The bot isn\'t connected to a voice channel.')
+
+ if (message.guild.me.voiceChannelID !== message.member.voiceChannelID) return message.reply('Error: You aren\'t connected in the same voice channel as the bot...');
+
+ message.guild.me.voiceChannel.leave();
+
+ message.channel.send("Leaving channel...")
+
};
exports.conf = {
@@ -29,8 +37,7 @@ module.exports.run = async (client, message) => {
};
exports.help = {
name: 'leave',
- description: 'Makes the bot leave the server',
+ description: 'Leaves voice chat.',
usage: 'leave',
- category: '- Owners Only',
- };
- \ No newline at end of file
+ category: '- Music Commands',
+ }; \ No newline at end of file