From 872d134b65408aa64dfea4cdbcc9de874bab03b7 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Wed, 9 Nov 2022 20:02:20 +0700 Subject: [PATCH] fix stuff --- commands/music.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/commands/music.js b/commands/music.js index 748e498..5a99624 100644 --- a/commands/music.js +++ b/commands/music.js @@ -138,8 +138,10 @@ module.exports = { switch (args[0]) { case 'play': play(bot, args.slice(1)); + break; case 'playurl': playUrl(bot, args.slice(1)); + break; case 'stop': try { bot.tellraw('@a', {text: 'Cleared the song queue'}); @@ -147,6 +149,7 @@ module.exports = { return; } bot.music.stop(); + break; case 'skip': try { bot.tellraw('@a', [{text: 'Skipping '}, {text: bot.music.song.name, color: 'gold'}]); @@ -154,6 +157,7 @@ module.exports = { } catch (e) { throw new Error('No music is currently playing!'); } + break; case 'loop': switch (args[1]) { case 'off': @@ -167,6 +171,7 @@ module.exports = { color: 'red', }, ]); + break; case 'current': bot.music.loop = 1; bot.tellraw('@a', [ @@ -178,16 +183,19 @@ module.exports = { color: 'gold', }, ]); + break; case 'all': bot.music.loop = 2; bot.tellraw('@a', { text: 'Now looping every song in the queue', }); + break; default: throw new SyntaxError('Invalid argument'); } case 'list': list(bot, false, null, prefix); + break; case 'nowplaying': bot.tellraw('@a', [ { @@ -198,6 +206,7 @@ module.exports = { color: 'gold', }, ]); + break; case 'queue': const queueWithName = []; bot.music.queue.forEach((song) => queueWithName.push(song.name)); @@ -211,16 +220,20 @@ module.exports = { color: 'aqua', }, ]); + break; default: throw new SyntaxError('Invalid argument'); } }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { + let Embed; switch (args[0]) { case 'play': play(bot, args.slice(1), true, channeldc); + break; case 'playurl': playUrl(bot, args.slice(1), true, channeldc); + break; case 'stop': try { const Embed = new MessageEmbed() @@ -232,6 +245,7 @@ module.exports = { return; } bot.music.stop(); + break; case 'skip': try { const Embed = new MessageEmbed() @@ -243,8 +257,8 @@ module.exports = { } catch (e) { throw new Error('No music is currently playing!'); } + break; case 'loop': - let Embed; switch (args[1]) { case 'off': bot.music.loop = 0; @@ -253,6 +267,7 @@ module.exports = { .setTitle('Loop') .setDescription('Looping is now disabled'); channeldc.send({embeds: [Embed]}); + break; case 'current': bot.music.loop = 1; Embed = new MessageEmbed() @@ -260,6 +275,7 @@ module.exports = { .setTitle('Loop') .setDescription(`Now looping ${song.name}`); channeldc.send({embeds: [Embed]}); + break; case 'all': bot.music.loop = 2; Embed = new MessageEmbed() @@ -267,15 +283,18 @@ module.exports = { .setTitle('Loop') .setDescription('Now looping every song in the queue'); channeldc.send({embeds: [Embed]}); + break; } case 'list': list(bot, true, channeldc, prefix); + break; case 'nowplaying': Embed = new MessageEmbed() .setColor('#FFFF00') .setTitle('Now playing') .setDescription(`Now playing ${bot.music.song.name}`); channeldc.send({embeds: [Embed]}); + break; case 'queue': const queueWithName = []; bot.music.queue.forEach((song) => queueWithName.push(song.name)); @@ -284,6 +303,7 @@ module.exports = { .setTitle('Queue') .setDescription(queueWithName.join(', ')); channeldc.send({embeds: [Embed]}); + break; default: throw new SyntaxError('Invalid argument'); }