From b8b09face27f18fd1242e55dbeabbecc3591aabe Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 18:39:17 +0100 Subject: contextual play should add to the last in the queue Signed-off-by: salmonik --- src/commands/music.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/commands') diff --git a/src/commands/music.rs b/src/commands/music.rs index 26e655e..ecc75c8 100644 --- a/src/commands/music.rs +++ b/src/commands/music.rs @@ -15,10 +15,7 @@ type Context<'a> = poise::Context<'a, Data, Error>; // ── Source classification ────────────────────────────────────────── /// Music playback and queue management. -#[poise::command( - slash_command, - subcommands("grajcuj", "skip", "queue", "stop", "join") -)] +#[poise::command(slash_command, subcommands("grajcuj", "skip", "queue", "stop", "join"))] pub async fn music(_ctx: Context<'_>) -> Result<()> { Ok(()) } @@ -32,8 +29,9 @@ pub async fn grajcuj( melodia: Option, #[description = "Bezpośredni plik z twojego systemu"] file: Option, #[description = "Chujowa kompresja!?"] compressed: Option, - #[description = "Gdzie dodać utwór w kolejce (domyślnie: last)"] - position: Option, + #[description = "Gdzie dodać utwór w kolejce (domyślnie: last)"] position: Option< + QueuePosition, + >, ) -> Result<()> { play_command(ctx, melodia, file, compressed, position).await } @@ -379,11 +377,11 @@ pub async fn message_grajcuj(ctx: Context<'_>, message: serenity::Message) -> Re .iter() .find(|a| matches!(file_type(&a.filename), FileType::Audio | FileType::Video)) { - return play_impl(ctx, None, Some(att.clone()), false, QueuePosition::Now).await; + return play_impl(ctx, None, Some(att.clone()), false, QueuePosition::Last).await; } // Fallback: first URL in message content. if let Some(url) = extract_urls(&message.content).into_iter().next() { - return play_impl(ctx, Some(url), None, false, QueuePosition::Now).await; + return play_impl(ctx, Some(url), None, false, QueuePosition::Last).await; } ctx.say(lang::L_MUSIC_NO_AUDIO_ATTACHMENTS).await?; Ok(()) -- cgit v1.2.3