split main.rs into files

This commit is contained in:
2024-02-16 14:23:20 +01:00
parent eacf4fffae
commit 8a8a807547
14 changed files with 477 additions and 276 deletions

17
src/commands/leave.rs Normal file
View File

@@ -0,0 +1,17 @@
use crate::state::State;
use std::error::Error;
use twilight_model::channel::Message;
pub(crate) async fn leave(
msg: Message,
state: State,
) -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
tracing::debug!(
"leave command in channel {} by {}",
msg.channel_id,
msg.author.name
);
let guild_id = msg.guild_id.unwrap();
state.songbird.leave(guild_id).await?;
Ok(())
}