From 2783ab5634b54492c2d487d11bcacad767f57833 Mon Sep 17 00:00:00 2001 From: Alee Date: Sun, 24 Jun 2018 22:36:58 -0400 Subject: Added music back (finally) and changed from 2.10.1 to 2.11.0 Beta --- commands/leave.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'commands/leave.js') 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 . * * *************************************/ -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 -- cgit v1.2.3