From f00c76f2c58ad05af0ee4a403c686c5fb1801d04 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 20 Jan 2022 23:22:19 -0500 Subject: [PATCH] Fix set volume logic --- src/commands.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 0098dc2..f960ac9 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -282,11 +282,15 @@ pub async fn set_volume(ctx: &mut Context, command: &ApplicationCommandInteracti let current_track = data.get::().unwrap(); if let Some(track) = current_track { - if track.set_volume(new_volume).is_ok() { - return format!("Setting volume to {}%.", volume); + if track.set_volume(new_volume).is_err() { + return format!( + "Setting volume to {}%, but it didn't work for the current track for some reason.", + volume + ); } } - "Nothing's currently playing and for some reason, something needs to be playing to set the volume.".to_string() + + format!("Setting volume to {}%.", volume) } pub async fn set_loop(ctx: &mut Context, command: &ApplicationCommandInteraction) -> String {