woomy/commands/movehere.js

37 lines
1 KiB
JavaScript
Raw Permalink Normal View History

2020-04-23 15:15:48 +00:00
// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license.
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
2020-04-29 11:00:11 +00:00
permLevel: 'User',
2020-04-23 15:15:48 +00:00
requiredPerms: ['CONNECT', 'SPEAK'],
2020-04-29 11:00:11 +00:00
cooldown: 2000
2020-04-23 15:15:48 +00:00
}
exports.help = {
name: 'movehere',
category: 'Music',
2020-04-29 11:00:11 +00:00
description: 'Moves music related messages to the channel the this command is ran in.',
2020-04-23 15:15:48 +00:00
usage: 'movehere',
parameters: ''
}
const music = require('../utils/music')
exports.run = async (client, message, args, level, data) => {
// get guild music data
2020-04-28 09:35:11 +00:00
const guild = music.getGuild(message.guild.id)
2020-04-23 15:15:48 +00:00
2020-04-28 09:35:11 +00:00
if (!guild.playing) {
2020-04-23 15:15:48 +00:00
return message.channel.send('<:error:466995152976871434> Nothing is playing.')
}
2020-04-29 11:00:11 +00:00
if (guild.channel.id === message.channel.id) {
return message.channel.send('<:error:466995152976871434> Music messages are already being sent to this channel.')
2020-04-23 15:15:48 +00:00
}
2020-04-29 11:00:11 +00:00
guild.channel = message.channel
2020-04-23 15:15:48 +00:00
2020-04-29 11:00:11 +00:00
message.channel.send('<:success:466995111885144095> Music messages will now be sent to this channel.')
2020-04-23 15:15:48 +00:00
}