nyx/commands/Music/volume.js

26 lines
995 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
module.exports = {
name: "volume",
description: "To change the server song queue volume",
usage: "(Number)",
2021-07-13 05:17:39 +02:00
aliases: ["vol", "v"],
2021-06-12 12:53:51 +02:00
category: "Music",
2021-07-13 05:17:39 +02:00
description: "Set volume level of the music",
2021-06-12 12:53:51 +02:00
run: async (client, message, args) => {
2021-07-13 05:17:39 +02:00
const player = message.client.manager.get(message.guild.id);
if (!player) return client.err(message, "Music", "volume", 34);
if (!args.length)
return message.inlineReply(`The player volume is \`${player.volume}\``);
const { channel } = message.member.voice;
2021-06-12 12:53:51 +02:00
if (!channel) return client.err(message, "Music", "volume", 35);
2021-07-13 05:17:39 +02:00
if (channel.id !== player.voiceChannel)
return client.err(message, "Music", "volume", 55);
const volume = Number(args[0]);
if (!volume || volume < 1 || volume > 100 || isNaN(volume))
2021-06-12 12:53:51 +02:00
return client.err(message, "Music", "volume", 101);
2021-07-13 05:17:39 +02:00
player.setVolume(volume);
return message.inlineReply(
`The player's volume has been set to \`${volume}\`.`
);
2021-06-12 12:53:51 +02:00
},
};