From 5c6938369d7125de1c51364790fb63bab68cf7fb Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 29 Apr 2020 21:21:34 +1000 Subject: [PATCH] polish --- commands/movesong.js | 6 +++--- commands/pause.js | 6 +++--- commands/removesong.js | 12 ++++-------- commands/resume.js | 6 +++--- commands/shuffle.js | 6 +++--- commands/skip.js | 2 +- commands/volume.js | 14 ++++++++++++-- commands/voteskip.js | 4 ++-- 8 files changed, 31 insertions(+), 25 deletions(-) diff --git a/commands/movesong.js b/commands/movesong.js index 01807f0..4645952 100644 --- a/commands/movesong.js +++ b/commands/movesong.js @@ -45,16 +45,16 @@ module.exports.run = (client, message, args, level) => { } if (oldPosition < 1 || oldPosition >= queue.length) { - return message.channel.send('<:error:466995152976871434> Invalid song ID.') + return message.channel.send('<:error:466995152976871434> Old position is not a valid song ID.') } if (newPosition < 1 || newPosition >= queue.length) { - return message.channel.send('<:error:466995152976871434> Invalid song ID.') + return message.channel.send('<:error:466995152976871434> New position is not a valid song ID.') } const songName = queue[oldPosition].video.title queue.splice(newPosition, 0, queue.splice(oldPosition, 1)[0]) - message.channel.send(`Moved **${songName}** from position \`${oldPosition}\` to \`${newPosition}\``) + message.channel.send(`<:success:466995111885144095> Moved **${songName}** from position \`${oldPosition}\` to \`${newPosition}\``) } diff --git a/commands/pause.js b/commands/pause.js index 9b6e8e0..a8b4f22 100644 --- a/commands/pause.js +++ b/commands/pause.js @@ -22,16 +22,16 @@ exports.run = async (client, message, args, level, data) => { const guild = getGuild(message.guild.id) if (guild.paused === true) { - return message.channel.send('The music has already been paused! Run resume to start the music again.') + return message.channel.send('<:error:466995152976871434> The music has already been paused! Run resume to start the music again.') } if (guild.queue.length < 1 || guild.playing === false) { - return message.channel.send('Nothing is playing!') + return message.channel.send('<:error:466995152976871434> Nothing is playing!') } guild.playing = false guild.paused = true guild.dispatcher.pause() - message.channel.send('Music paused!') + message.channel.send('<:pause:467639357961142273> Music playback has been paused.') } diff --git a/commands/removesong.js b/commands/removesong.js index c1d7daf..63a5891 100644 --- a/commands/removesong.js +++ b/commands/removesong.js @@ -32,20 +32,16 @@ module.exports.run = (client, message, args, level) => { var input = +args[0] if (isNaN(input) === true) { - return message.channel.send('That isn\'t a number! You need to tell me the songs position in the queue (1, 2, etc.)') + return message.channel.send('<:error:466995152976871434> That isn\'t a number! You need to tell me the songs position in the queue (1, 2, etc.)') } - if (input >= queue.length) { - return message.channel.send('Invalid (too large)') - } - - if (input < 1) { - return message.channel.send('Invalid (too small)') + if (input >= queue.length || input < 1) { + return message.channel.send('<:error:466995152976871434> Input is not a valid song ID.') } var songName = queue[input].video.title queue.splice(input, 1) - message.channel.send(`Removed from queue: **${songName}**`) + message.channel.send(`<:success:466995111885144095> Removed from queue: **${songName}**`) } diff --git a/commands/resume.js b/commands/resume.js index 6208e7a..96aa05c 100644 --- a/commands/resume.js +++ b/commands/resume.js @@ -22,16 +22,16 @@ exports.run = async (client, message, args, level, data) => { const guild = getGuild(message.guild.id) if (guild.paused === false) { - return message.channel.send('The music is already playing, use pause to pause the music first!') + return message.channel.send('<:error:466995152976871434> The music is already playing, use pause to pause the music first!') } if (guild.queue.length < 1) { - return message.channel.send('Nothing is playing!') + return message.channel.send('<:error:466995152976871434> Nothing is playing!') } guild.playing = true guild.paused = false guild.dispatcher.resume() - message.channel.send('Music resumed!') + message.channel.send('<:success:466995111885144095> Music playback has been resumed.') } diff --git a/commands/shuffle.js b/commands/shuffle.js index 01f02c2..0c81e1c 100644 --- a/commands/shuffle.js +++ b/commands/shuffle.js @@ -21,8 +21,8 @@ const { getGuild } = require('../utils/music') module.exports.run = (client, message, args, level) => { var queue = getGuild(message.guild.id).queue - if (queue.length < 3) { - return message.channel.send('Not enough songs are in the queue for this command to work!') + if (queue.length < 4) { + return message.channel.send('<:error:466995152976871434> There aren\'t enough songs are in the queue for this command to work!') } const max = queue.length - 1 @@ -34,5 +34,5 @@ module.exports.run = (client, message, args, level) => { queue[i] = itemAtIndex } - message.channel.send('Queue shuffled!') + message.channel.send('<:success:466995111885144095> Queue shuffled!') } diff --git a/commands/skip.js b/commands/skip.js index 13124b8..c55c061 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -21,5 +21,5 @@ const { skip } = require('../utils/music') exports.run = async (client, message, args, level, data) => { skip(message.guild, 'skip') - message.reply('skipped currently playing music') + message.reply('<:success:466995111885144095> Song skipped.') } diff --git a/commands/volume.js b/commands/volume.js index 168c89a..78b5a33 100644 --- a/commands/volume.js +++ b/commands/volume.js @@ -4,7 +4,7 @@ exports.conf = { enabled: true, guildOnly: true, aliases: ['vol'], - permLevel: 'Moderator', + permLevel: 'User', requiredPerms: [], cooldown: 2000 } @@ -19,7 +19,17 @@ exports.help = { const { setVolume } = require('../utils/music') exports.run = async (client, message, args, level, data) => { - let userVolume = args[0] + let userVolume + + if (args[0].includes('%')) { + userVolume.replace('%', '') + } + + userVolume = +userVolume + + if (isNaN(userVolume) === true) { + return message.channel.send('<:error:466995152976871434> Input must be a number!') + } if (userVolume) { userVolume = Number(userVolume) diff --git a/commands/voteskip.js b/commands/voteskip.js index 489ecdb..6792b8c 100644 --- a/commands/voteskip.js +++ b/commands/voteskip.js @@ -39,7 +39,7 @@ exports.run = (client, message, args, level) => { skip(message.guild, 'skip') message.channel.send( - '<:skip:467216735356059660> Song has been skipped by the user who requested it.' + '<:success:466995111885144095> Song has been skipped by the user who requested it.' ) return @@ -52,7 +52,7 @@ exports.run = (client, message, args, level) => { skip(message.guild, 'skip') message.channel.send( - '<:skip:467216735356059660> Song has been skipped.' + '<:skip:467216735356059660> Song skipped.' ) } else { message.channel.send(