Fix set volume logic
This commit is contained in:
parent
256094e15b
commit
f00c76f2c5
1 changed files with 7 additions and 3 deletions
|
@ -282,11 +282,15 @@ pub async fn set_volume(ctx: &mut Context, command: &ApplicationCommandInteracti
|
||||||
|
|
||||||
let current_track = data.get::<CurrentlyPlayingTrack>().unwrap();
|
let current_track = data.get::<CurrentlyPlayingTrack>().unwrap();
|
||||||
if let Some(track) = current_track {
|
if let Some(track) = current_track {
|
||||||
if track.set_volume(new_volume).is_ok() {
|
if track.set_volume(new_volume).is_err() {
|
||||||
return format!("Setting volume to {}%.", volume);
|
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 {
|
pub async fn set_loop(ctx: &mut Context, command: &ApplicationCommandInteraction) -> String {
|
||||||
|
|
Loading…
Add table
Reference in a new issue