From beaa15f15ff3dda89b776dc12d54140117250902 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Sat, 9 May 2020 10:12:35 +0100 Subject: [PATCH] removed join and leave commands --- commands/music/join.js | 38 -------------------------------------- commands/music/leave.js | 41 ----------------------------------------- 2 files changed, 79 deletions(-) delete mode 100644 commands/music/join.js delete mode 100644 commands/music/leave.js diff --git a/commands/music/join.js b/commands/music/join.js deleted file mode 100644 index 8af98e7..0000000 --- a/commands/music/join.js +++ /dev/null @@ -1,38 +0,0 @@ -const { Command } = require('discord.js-commando'); -const { MessageEmbed } = require('discord.js'); - -module.exports = class JoinCommand extends Command { - constructor(client) { - super(client, { - name: 'join', - memberName: 'join', - group: 'music', - description: 'joins a voice channel', - aliases: ['summon'], - guildOnly: true, - throttling: { - usages: 1, - duration: 5 - } - }); - } - - run = async message => { - try { - const voiceChannel = message.member.voice.channel; - - if (!voiceChannel) { - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: You need to join a voice channel first'); - return await message.say({ embed }); - } - - await voiceChannel.join(); - const embed = new MessageEmbed().setColor('#000099').setTitle('Joined'); - return await message.say({ embed }); - } catch(err) { - console.error(err); - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon'); - return message.say({ embed }); - } - } -} \ No newline at end of file diff --git a/commands/music/leave.js b/commands/music/leave.js deleted file mode 100644 index 8897716..0000000 --- a/commands/music/leave.js +++ /dev/null @@ -1,41 +0,0 @@ -const { Command } = require('discord.js-commando'); -const { MessageEmbed } = require('discord.js'); - -module.exports = class Leave extends Command { - constructor(client) { - super(client, { - name: 'leave', - memberName: 'leave', - group: 'music', - description: 'leaves a voice channel', - guildOnly: true, - throttling: { - usages: 1, - duration: 5 - } - }); - } - - run = async message => { - try { - const voiceChannel = message.member.voice.channel; - - if (!voiceChannel) { - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: You need to join a voice channel first'); - return await message.say({ embed }); - } - - message.guild.music.queue = []; - message.guild.music.isPlaying = false; - message.guild.music.nowPlaying = null; - message.guild.music.dispatcher = null; - const embed = new MessageEmbed().setColor('#000099').setTitle('Left'); - voiceChannel.leave(); - return await message.say({ embed }); - } catch (err) { - console.error(err); - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon'); - return message.say({ embed }); - } - } -} \ No newline at end of file