woomy/src/commands/pause.js

36 lines
861 B
JavaScript
Raw Normal View History

const { getGuild } = require('../modules/music')
2020-01-25 10:02:43 +00:00
exports.run = (client, message, args, level) => {
const guild = getGuild(message.guild.id)
2020-01-25 10:02:43 +00:00
if (guild.paused === true) {
return message.channel.send('<:error:466995152976871434> The music has already been paused! Run resume to start the music again.')
}
2020-01-25 10:02:43 +00:00
if (guild.queue.length < 1 || guild.playing === false) {
return message.channel.send('<:error:466995152976871434> Nothing is playing!')
}
2020-01-25 10:02:43 +00:00
guild.playing = false
guild.paused = true
guild.dispatcher.pause()
message.channel.send('<:pause:467639357961142273> Music playback has been paused.')
2020-01-25 10:02:43 +00:00
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "Moderator",
requiredPerms: []
2020-01-25 10:02:43 +00:00
};
exports.help = {
name: "pause",
category: "Music",
description: "Pauses music playback.",
usage: "pause"
};