This commit is contained in:
Emily 2020-04-29 21:21:34 +10:00
parent a31dc02568
commit 5c6938369d
8 changed files with 31 additions and 25 deletions

View file

@ -45,16 +45,16 @@ module.exports.run = (client, message, args, level) => {
} }
if (oldPosition < 1 || oldPosition >= queue.length) { 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) { 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 const songName = queue[oldPosition].video.title
queue.splice(newPosition, 0, queue.splice(oldPosition, 1)[0]) 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}\``)
} }

View file

@ -22,16 +22,16 @@ exports.run = async (client, message, args, level, data) => {
const guild = getGuild(message.guild.id) const guild = getGuild(message.guild.id)
if (guild.paused === true) { 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) { 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.playing = false
guild.paused = true guild.paused = true
guild.dispatcher.pause() guild.dispatcher.pause()
message.channel.send('Music paused!') message.channel.send('<:pause:467639357961142273> Music playback has been paused.')
} }

View file

@ -32,20 +32,16 @@ module.exports.run = (client, message, args, level) => {
var input = +args[0] var input = +args[0]
if (isNaN(input) === true) { 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) { if (input >= queue.length || input < 1) {
return message.channel.send('Invalid (too large)') return message.channel.send('<:error:466995152976871434> Input is not a valid song ID.')
}
if (input < 1) {
return message.channel.send('Invalid (too small)')
} }
var songName = queue[input].video.title var songName = queue[input].video.title
queue.splice(input, 1) queue.splice(input, 1)
message.channel.send(`Removed from queue: **${songName}**`) message.channel.send(`<:success:466995111885144095> Removed from queue: **${songName}**`)
} }

View file

@ -22,16 +22,16 @@ exports.run = async (client, message, args, level, data) => {
const guild = getGuild(message.guild.id) const guild = getGuild(message.guild.id)
if (guild.paused === false) { 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) { 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.playing = true
guild.paused = false guild.paused = false
guild.dispatcher.resume() guild.dispatcher.resume()
message.channel.send('Music resumed!') message.channel.send('<:success:466995111885144095> Music playback has been resumed.')
} }

View file

@ -21,8 +21,8 @@ const { getGuild } = require('../utils/music')
module.exports.run = (client, message, args, level) => { module.exports.run = (client, message, args, level) => {
var queue = getGuild(message.guild.id).queue var queue = getGuild(message.guild.id).queue
if (queue.length < 3) { if (queue.length < 4) {
return message.channel.send('Not enough songs are in the queue for this command to work!') 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 const max = queue.length - 1
@ -34,5 +34,5 @@ module.exports.run = (client, message, args, level) => {
queue[i] = itemAtIndex queue[i] = itemAtIndex
} }
message.channel.send('Queue shuffled!') message.channel.send('<:success:466995111885144095> Queue shuffled!')
} }

View file

@ -21,5 +21,5 @@ const { skip } = require('../utils/music')
exports.run = async (client, message, args, level, data) => { exports.run = async (client, message, args, level, data) => {
skip(message.guild, 'skip') skip(message.guild, 'skip')
message.reply('skipped currently playing music') message.reply('<:success:466995111885144095> Song skipped.')
} }

View file

@ -4,7 +4,7 @@ exports.conf = {
enabled: true, enabled: true,
guildOnly: true, guildOnly: true,
aliases: ['vol'], aliases: ['vol'],
permLevel: 'Moderator', permLevel: 'User',
requiredPerms: [], requiredPerms: [],
cooldown: 2000 cooldown: 2000
} }
@ -19,7 +19,17 @@ exports.help = {
const { setVolume } = require('../utils/music') const { setVolume } = require('../utils/music')
exports.run = async (client, message, args, level, data) => { 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) { if (userVolume) {
userVolume = Number(userVolume) userVolume = Number(userVolume)

View file

@ -39,7 +39,7 @@ exports.run = (client, message, args, level) => {
skip(message.guild, 'skip') skip(message.guild, 'skip')
message.channel.send( 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 return
@ -52,7 +52,7 @@ exports.run = (client, message, args, level) => {
skip(message.guild, 'skip') skip(message.guild, 'skip')
message.channel.send( message.channel.send(
'<:skip:467216735356059660> Song has been skipped.' '<:skip:467216735356059660> Song skipped.'
) )
} else { } else {
message.channel.send( message.channel.send(