woomy/commands/resume.js

38 lines
989 B
JavaScript
Raw Normal View History

2020-04-20 09:19:32 +00:00
// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license.
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['unpause'],
permLevel: 'User',
requiredPerms: [],
cooldown: 2000
}
exports.help = {
name: 'resume',
category: 'Music',
description: 'Starts music back up if it was paused.',
usage: 'resume',
parameters: ''
}
const { getGuild } = require('../utils/music')
exports.run = async (client, message, args, level, data) => {
const guild = getGuild(message.guild.id)
if (guild.paused === false) {
2020-04-29 11:21:34 +00:00
return message.channel.send('<:error:466995152976871434> The music is already playing, use pause to pause the music first!')
2020-04-20 09:19:32 +00:00
}
if (guild.queue.length < 1) {
2020-04-29 11:21:34 +00:00
return message.channel.send('<:error:466995152976871434> Nothing is playing!')
2020-04-20 09:19:32 +00:00
}
guild.playing = true
guild.paused = false
guild.dispatcher.resume()
2020-04-29 11:21:34 +00:00
message.channel.send('<:success:466995111885144095> Music playback has been resumed.')
2020-04-20 09:19:32 +00:00
}