Add max volume. Not limiting it was a horrible idea

This commit is contained in:
Christopher Cookman 2024-05-09 21:42:11 -06:00
parent 8436139593
commit 7f8abdf079
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -969,6 +969,7 @@ discord.on("interactionCreate", async (interaction) => {
volume = interaction.options.getInteger("volume")/100; volume = interaction.options.getInteger("volume")/100;
// Make sure volume isnt negative // Make sure volume isnt negative
if (volume < 0) volume = 0; if (volume < 0) volume = 0;
if (volume > 1) volume = 1;
res = setVolume(channel, volume) res = setVolume(channel, volume)
if (res) { if (res) {
interaction.reply({ content: `Set volume to ${volume*100}%` }); interaction.reply({ content: `Set volume to ${volume*100}%` });