From bab3f614f8b42545fdb0101c4e353c87e0966d47 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 18:18:07 +0100 Subject: music: group playback commands under /music Graduate grajcuj/skip/queue/stop/join into the /music parent and drop the top-level names. On startup, reconcile global slash commands and delete any that are no longer registered, since Discord otherwise keeps stale commands after a rename or move. Docs updated for the new command layout and queue semantics. --- src/commands/music.rs | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'src/commands/music.rs') diff --git a/src/commands/music.rs b/src/commands/music.rs index 8841329..26e655e 100644 --- a/src/commands/music.rs +++ b/src/commands/music.rs @@ -15,7 +15,10 @@ type Context<'a> = poise::Context<'a, Data, Error>; // ── Source classification ────────────────────────────────────────── /// Music playback and queue management. -#[poise::command(slash_command, subcommands("grajcuj", "skip", "queue"))] +#[poise::command( + slash_command, + subcommands("grajcuj", "skip", "queue", "stop", "join") +)] pub async fn music(_ctx: Context<'_>) -> Result<()> { Ok(()) } @@ -29,25 +32,8 @@ 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< - QueuePosition, - >, -) -> Result<()> { - play_command(ctx, melodia, file, compressed, position).await -} - -/// Play music from Copyparty, URL, or file upload (top-level alias) -#[poise::command(slash_command, rename = "grajcuj")] -pub async fn grajcuj_top( - ctx: Context<'_>, - #[description = "Plik do odtworzenia"] - #[autocomplete = "audio_file"] - 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< - QueuePosition, - >, + #[description = "Gdzie dodać utwór w kolejce (domyślnie: last)"] + position: Option, ) -> Result<()> { play_command(ctx, melodia, file, compressed, position).await } @@ -404,5 +390,5 @@ pub async fn message_grajcuj(ctx: Context<'_>, message: serenity::Message) -> Re } pub fn commands() -> Vec> { - vec![music(), grajcuj_top(), stop(), join(), message_grajcuj()] + vec![music(), message_grajcuj()] } -- cgit v1.2.3