Skip to content

Commit

Permalink
[Enhancement] volume command argument will now only take a number u…
Browse files Browse the repository at this point in the history
…p to 100!
  • Loading branch information
naseif committed Nov 17, 2021
1 parent c3da4b0 commit 0715fd0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion commands/Music/volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,15 @@ module.exports = {

if (!volume)
return await message.channel.send({
embeds: [embedMessage("RED", `❌ Volume must be a number!`)],
embeds: [embedMessage("RED", `❌ Volume must be a valid number!`)],
});

try {
if (volume < 0 || volume > 100)
return await message.channel.send({
embeds: [embedMessage("RED", `Volume must be between 1 and 100!`)],
});

queue.setVolume(volume);
return await message.channel.send({
embeds: [
Expand Down Expand Up @@ -151,6 +156,11 @@ module.exports = {
});

try {
if (volume < 0 || volume > 100)
return await interaction.followUp({
embeds: [embedMessage("RED", `Volume must be between 1 and 100!`)],
});

queue.setVolume(volume);
return await interaction.followUp({
embeds: [
Expand Down

0 comments on commit 0715fd0

Please sign in to comment.