0.5.1 refractor

This commit is contained in:
2024-02-16 12:42:38 +01:00
parent 639fd7775f
commit 8a947926f7
37 changed files with 694 additions and 281 deletions

View File

@@ -1,15 +1,12 @@
use crate::{commands::embeds::{error_embed, embed}, Context, Error};
use crate::{
commands::embeds::{embed, error_embed},
Context, Error,
};
use poise::CreateReply;
/// Skips the currently playing song
#[poise::command(
prefix_command,
slash_command,
category = "Music"
)]
pub async fn skip(
ctx: Context<'_>
) -> Result<(), Error> {
#[poise::command(prefix_command, slash_command, category = "Music")]
pub async fn skip(ctx: Context<'_>) -> Result<(), Error> {
let guild_id = ctx.guild_id().unwrap();
let manager = songbird::get(&ctx.serenity_context())
@@ -23,13 +20,22 @@ pub async fn skip(
let _ = queue.skip();
ctx.send(
CreateReply::default().embed(embed(ctx, "Skipped!", "Next song: {song}", &format!("Songs left in queue: {}", queue.len())).await.unwrap())
).await?;
CreateReply::default().embed(
embed(
ctx,
"Skipped!",
"Next song: {song}",
&format!("Songs left in queue: {}", queue.len()),
)
.await
.unwrap(),
),
)
.await?;
} else {
let msg = "I am not in a voice channel!";
ctx.send(
CreateReply::default().embed(error_embed(ctx, msg).await.unwrap())
).await?;
ctx.send(CreateReply::default().embed(error_embed(ctx, msg).await.unwrap()))
.await?;
}
Ok(())