This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
legacy-musicbot/commands/music/volume.js
2020-12-12 00:34:12 +01:00

20 lines
911 B
JavaScript

module.exports = {
name: 'volume',
aliases: [],
category: 'Music',
utilisation: '{prefix}volume [1-100]',
execute(client, message, args) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
if (!args[0] || isNaN(args[0])) return message.channel.send(`${client.emotes.error} - Please enter a valid number !`);
if (Math.round(parseInt(args[0])) < 1 || Math.round(parseInt(args[0])) > 100) return message.channel.send(`${client.emotes.error} - Please enter a valid number (between 1 and 100) !`);
client.player.setVolume(message, args[0]);
message.channel.send(`${client.emotes.success} - Volume set to **${parseInt(args[0])}%** !`);
},
};