aboutsummaryrefslogtreecommitdiff
path: root/src/commands/playback.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/playback.rs')
-rw-r--r--src/commands/playback.rs12
1 files changed, 9 insertions, 3 deletions
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<Item = poise::Command<PoiseData, anyhow::Error>> {
@@ -74,6 +73,9 @@ pub async fn _play(ctx: PoiseContext<'_>, url: &url::Url) -> anyhow::Result<()>
data.get::<HttpKey>().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::<songbird::tracks::Track>();
+
// 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?;