Fix set volume logic

This commit is contained in:
Alex Page 2022-01-20 23:22:19 -05:00
parent 256094e15b
commit f00c76f2c5

View file

@ -282,11 +282,15 @@ pub async fn set_volume(ctx: &mut Context, command: &ApplicationCommandInteracti
let current_track = data.get::<CurrentlyPlayingTrack>().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 {