porting over music commands
This commit is contained in:
parent
4d02b3bc7e
commit
39fa428614
6 changed files with 309 additions and 6 deletions
37
commands/pause.js
Normal file
37
commands/pause.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license.
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
permLevel: 'User',
|
||||
requiredPerms: [],
|
||||
cooldown: 2000
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: 'pause',
|
||||
category: 'Music',
|
||||
description: 'Pauses the music that is currently playing.',
|
||||
usage: 'pause',
|
||||
parameters: ''
|
||||
}
|
||||
|
||||
const { getGuild } = require('../utils/music')
|
||||
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.')
|
||||
}
|
||||
|
||||
if (guild.queue.length < 1 || guild.playing === false) {
|
||||
return message.channel.send('Nothing is playing!')
|
||||
}
|
||||
|
||||
guild.playing = false
|
||||
guild.paused = true
|
||||
guild.dispatcher.pause()
|
||||
|
||||
message.channel.send('Music paused!')
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue