woomy/commands/volume.js

33 lines
656 B
JavaScript
Raw Normal View History

2020-04-11 14:45:47 +00:00
exports.conf = {
enabled: true,
guildOnly: true,
2020-04-13 04:28:53 +00:00
aliases: ['vol'],
2020-04-12 09:31:52 +00:00
permLevel: 'Moderator',
2020-04-13 04:28:53 +00:00
requiredPerms: [],
2020-04-11 14:45:47 +00:00
cooldown: 2000
}
exports.help = {
name: 'volume',
category: 'Music',
description: 'Sets volume of currently playing music. (100% = 25% of the actual volume)',
usage: 'volume [volume]',
parameters: '[volume] - Target volume from 0-100%'
2020-04-11 14:45:47 +00:00
}
exports.run = async (client, message, args, level, data) => {
2020-04-13 04:28:53 +00:00
let vol = args[0]
2020-04-11 14:45:47 +00:00
2020-04-13 04:28:53 +00:00
if (vol) {
vol = Number(vol)
2020-04-11 14:45:47 +00:00
2020-04-13 04:28:53 +00:00
vol = vol / 100 * 0.5
2020-04-11 14:45:47 +00:00
2020-04-13 04:28:53 +00:00
if (vol <= 1) {
client.music.setVolume(message.guild, vol)
2020-04-11 14:45:47 +00:00
2020-04-13 04:28:53 +00:00
message.reply('set volume to ' + vol * 100 + '%')
}
}
}