diff options
Diffstat (limited to 'src/commands/music.rs')
| -rw-r--r-- | src/commands/music.rs | 28 |
1 files changed, 7 insertions, 21 deletions
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>; | |||
| 15 | // ── Source classification ────────────────────────────────────────── | 15 | // ── Source classification ────────────────────────────────────────── |
| 16 | 16 | ||
| 17 | /// Music playback and queue management. | 17 | /// Music playback and queue management. |
| 18 | #[poise::command(slash_command, subcommands("grajcuj", "skip", "queue"))] | 18 | #[poise::command( |
| 19 | slash_command, | ||
| 20 | subcommands("grajcuj", "skip", "queue", "stop", "join") | ||
| 21 | )] | ||
| 19 | pub async fn music(_ctx: Context<'_>) -> Result<()> { | 22 | pub async fn music(_ctx: Context<'_>) -> Result<()> { |
| 20 | Ok(()) | 23 | Ok(()) |
| 21 | } | 24 | } |
| @@ -29,25 +32,8 @@ pub async fn grajcuj( | |||
| 29 | melodia: Option<String>, | 32 | melodia: Option<String>, |
| 30 | #[description = "Bezpośredni plik z twojego systemu"] file: Option<serenity::Attachment>, | 33 | #[description = "Bezpośredni plik z twojego systemu"] file: Option<serenity::Attachment>, |
| 31 | #[description = "Chujowa kompresja!?"] compressed: Option<bool>, | 34 | #[description = "Chujowa kompresja!?"] compressed: Option<bool>, |
| 32 | #[description = "Gdzie dodać utwór w kolejce (domyślnie: last)"] position: Option< | 35 | #[description = "Gdzie dodać utwór w kolejce (domyślnie: last)"] |
| 33 | QueuePosition, | 36 | position: Option<QueuePosition>, |
| 34 | >, | ||
| 35 | ) -> Result<()> { | ||
| 36 | play_command(ctx, melodia, file, compressed, position).await | ||
| 37 | } | ||
| 38 | |||
| 39 | /// Play music from Copyparty, URL, or file upload (top-level alias) | ||
| 40 | #[poise::command(slash_command, rename = "grajcuj")] | ||
| 41 | pub async fn grajcuj_top( | ||
| 42 | ctx: Context<'_>, | ||
| 43 | #[description = "Plik do odtworzenia"] | ||
| 44 | #[autocomplete = "audio_file"] | ||
| 45 | melodia: Option<String>, | ||
| 46 | #[description = "Bezpośredni plik z twojego systemu"] file: Option<serenity::Attachment>, | ||
| 47 | #[description = "Chujowa kompresja!?"] compressed: Option<bool>, | ||
| 48 | #[description = "Gdzie dodać utwór w kolejce (domyślnie: last)"] position: Option< | ||
| 49 | QueuePosition, | ||
| 50 | >, | ||
| 51 | ) -> Result<()> { | 37 | ) -> Result<()> { |
| 52 | play_command(ctx, melodia, file, compressed, position).await | 38 | play_command(ctx, melodia, file, compressed, position).await |
| 53 | } | 39 | } |
| @@ -404,5 +390,5 @@ pub async fn message_grajcuj(ctx: Context<'_>, message: serenity::Message) -> Re | |||
| 404 | } | 390 | } |
| 405 | 391 | ||
| 406 | pub fn commands() -> Vec<poise::Command<Data, Error>> { | 392 | pub fn commands() -> Vec<poise::Command<Data, Error>> { |
| 407 | vec![music(), grajcuj_top(), stop(), join(), message_grajcuj()] | 393 | vec![music(), message_grajcuj()] |
| 408 | } | 394 | } |
