diff --git a/src/commands/play.rs b/src/commands/play.rs index 13306a3..18ed87d 100644 --- a/src/commands/play.rs +++ b/src/commands/play.rs @@ -24,6 +24,20 @@ pub(crate) async fn play( interaction.author(), ); + let interaction_response_data = InteractionResponseDataBuilder::new() + .content("Adding tracks to the queue ...") + .flags(MessageFlags::EPHEMERAL) + .build(); + let response = InteractionResponse { + kind: InteractionResponseType::ChannelMessageWithSource, + data: Some(interaction_response_data), + }; + state + .http + .interaction(interaction.application_id) + .create_response(interaction.id, &interaction.token, &response) + .await?; + let Some(user_id) = interaction.author_id() else { return Ok(()); }; @@ -42,22 +56,6 @@ pub(crate) async fn play( debug!("query: {:?}", query); - let interaction_response_data = InteractionResponseDataBuilder::new() - .content("Adding tracks to the queue ...") - .flags(MessageFlags::EPHEMERAL) - .build(); - - let response = InteractionResponse { - kind: InteractionResponseType::ChannelMessageWithSource, - data: Some(interaction_response_data), - }; - - state - .http - .interaction(interaction.application_id) - .create_response(interaction.id, &interaction.token, &response) - .await?; - // handle playlist links let urls = if query.contains("list=") { get_playlist_urls(query).await? diff --git a/src/commands/queue.rs b/src/commands/queue.rs index 55a473c..b4f42d7 100644 --- a/src/commands/queue.rs +++ b/src/commands/queue.rs @@ -28,9 +28,9 @@ pub(crate) async fn queue( if queue.is_empty() { message.push_str("There are no tracks in the queue.\n"); } else { - message.push_str("Currently playing:\n"); + message.push_str("Next songs are:\n"); } - for track in queue { + for track in queue.iter().take(5) { let map = track.typemap().read().await; let metadata = map.get::().unwrap(); message.push_str(