From e0a9b18f45858829f88cbe20611aaf696fc5bf6a Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Fri, 16 Aug 2024 22:35:46 -0400 Subject: restore support for volume commands --- src/commands/playback.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/commands/playback.rs') diff --git a/src/commands/playback.rs b/src/commands/playback.rs index 8121136..4d6d0be 100644 --- a/src/commands/playback.rs +++ b/src/commands/playback.rs @@ -14,7 +14,6 @@ use crate::{ util, PoiseContext, PoiseData, - CONFIG, }; pub fn commands() -> impl IntoIterator> { @@ -74,6 +73,9 @@ pub async fn _play(ctx: PoiseContext<'_>, url: &url::Url) -> anyhow::Result<()> data.get::().unwrap().clone() }; + let volume = util::volume(ctx).await; + tracing::debug!(volume); + { let (_sb, call) = songbird(ctx).await?; let mut call = call.lock().await; @@ -86,9 +88,11 @@ pub async fn _play(ctx: PoiseContext<'_>, url: &url::Url) -> anyhow::Result<()> YoutubeDl::new_ytdl_like(&crate::config::YTDL_COMMAND, client.clone(), url.to_string()); let track = input.conv::(); + // TODO: store enqueueing channel so songbird handler can switch channels - call.enqueue(track).await; + let queued = call.enqueue(track).await; + queued.set_volume(volume as _)?; } util::react(ctx, '📣').await?; @@ -197,7 +201,9 @@ pub async fn list(ctx: PoiseContext<'_>) -> anyhow::Result<()> { let call = call.lock().await; let queue = call.queue(); - util::reply(ctx, "(command fix work-in-progress)").await?; + if queue.current_queue().is_empty() { + util::reply(ctx, "nothing queued").await?; + } for track in queue.current_queue().into_iter() { let info = track.get_info().await?; -- cgit v1.3.1