Major refactor

This commit is contained in:
2026-04-03 23:04:51 -04:00
parent e7f337c735
commit 35d07e8df1
124 changed files with 4929 additions and 2429 deletions

View File

@@ -0,0 +1,42 @@
use crate::{
chat::{edit_response, process_message},
handler::get_songbird,
};
use serenity::{
all::{CommandInteraction, CreateCommand},
prelude::*,
};
pub async fn run(ctx: &Context, command: &CommandInteraction) {
// Create the initial response
process_message(&ctx, &command, false).await;
// Get the songbird manager
let manager = get_songbird();
// Extract the guild ID
let guild_id = match command.guild_id {
Some(g) => g,
None => {
edit_response(
&ctx,
&command,
"Unable to find the current server ID".to_string(),
)
.await;
return;
}
};
// Stop the track and clear the queue
if let Some(handler_lock) = manager.get(guild_id) {
let handler = handler_lock.lock().await;
handler.queue().stop();
log::debug!("<{guild_id}> Stopped the track");
edit_response(&ctx, &command, "Stopping the tracks".to_string()).await;
}
}
pub fn register() -> CreateCommand {
CreateCommand::new("stop").description("Stop the current track and clear the queue")
}