add skip command

This commit is contained in:
2024-06-13 20:42:42 +02:00
parent 2c91c744dc
commit 55fe212424
3 changed files with 54 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
use crate::commands::queue::{build_action_row, build_queue_embeds, TRACKS_PER_PAGE};
use crate::commands::{delete, join, leave, pause, play, queue, resume, stop};
use crate::commands::{delete, join, leave, pause, play, queue, resume, skip, stop};
use crate::state::State;
use futures::Future;
use std::error::Error;
@@ -19,6 +19,7 @@ enum InteractionCommand {
Play(String),
Stop,
Pause,
Skip,
Resume,
Leave,
Join,
@@ -108,6 +109,9 @@ impl Handler {
InteractionCommand::Pause => {
spawn(pause(interaction, Arc::clone(&self.state)))
}
InteractionCommand::Skip => {
spawn(skip(interaction, Arc::clone(&self.state)))
}
InteractionCommand::Resume => {
spawn(resume(interaction, Arc::clone(&self.state)))
}
@@ -191,6 +195,7 @@ fn parse_interaction_command(command: &CommandData) -> InteractionCommand {
}
"stop" => InteractionCommand::Stop,
"pause" => InteractionCommand::Pause,
"skip" => InteractionCommand::Skip,
"resume" => InteractionCommand::Resume,
"leave" => InteractionCommand::Leave,
"join" => InteractionCommand::Join,