2024-03-10 19:36:02 +01:00
|
|
|
use crate::music::music_manager;
|
|
|
|
use crate::util::embed::Embed;
|
|
|
|
use serenity::all::{CommandInteraction, Context};
|
|
|
|
use serenity::builder::{CreateCommand, CreateEmbed};
|
|
|
|
|
2024-03-10 19:46:27 +01:00
|
|
|
pub async fn run(ctx: &Context, command: &CommandInteraction) -> CreateEmbed {
|
2024-03-10 19:36:02 +01:00
|
|
|
let username = command.user.name.as_str();
|
|
|
|
|
|
|
|
let guild_id = match &command.guild_id {
|
|
|
|
Some(guild_id) => guild_id,
|
|
|
|
None => {
|
2024-03-10 19:46:27 +01:00
|
|
|
return Embed::create_error_respose(
|
|
|
|
username,
|
|
|
|
"guild_id not found",
|
|
|
|
"Could not find guild id.",
|
|
|
|
);
|
2024-03-10 19:36:02 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-03-10 19:46:27 +01:00
|
|
|
music_manager::attempt_to_skip_current_song(ctx, guild_id, &command.user.id, &command.user.name)
|
|
|
|
.await
|
2024-03-10 19:36:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn register() -> CreateCommand {
|
|
|
|
CreateCommand::new("skip").description("Skip to the next song in queue")
|
|
|
|
}
|