mirror of
https://github.com/eRgo35/lyra.git
synced 2026-02-04 20:36:10 +01:00
0.5.1 refractor
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
use crate::{commands::embeds::{error_embed, embed}, Context, Error};
|
||||
use crate::{
|
||||
commands::embeds::{embed, error_embed},
|
||||
Context, Error,
|
||||
};
|
||||
use poise::CreateReply;
|
||||
|
||||
/// Stops playback and destroys the queue; \
|
||||
/// aliases: stop, end
|
||||
#[poise::command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
aliases("end"),
|
||||
category = "Music"
|
||||
)]
|
||||
pub async fn stop(
|
||||
ctx: Context<'_>
|
||||
) -> Result<(), Error> {
|
||||
#[poise::command(prefix_command, slash_command, aliases("end"), category = "Music")]
|
||||
pub async fn stop(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let guild_id = ctx.guild_id().unwrap();
|
||||
|
||||
|
||||
let manager = songbird::get(&ctx.serenity_context())
|
||||
.await
|
||||
.expect("Songbird client placed at init")
|
||||
@@ -25,14 +21,23 @@ pub async fn stop(
|
||||
queue.stop();
|
||||
|
||||
ctx.send(
|
||||
CreateReply::default().embed(embed(ctx, "Stopped!", "Playback stopped!", "Queue destroyed! Bot will stay and chill with you in a vc").await.unwrap())
|
||||
).await?;
|
||||
} else {
|
||||
CreateReply::default().embed(
|
||||
embed(
|
||||
ctx,
|
||||
"Stopped!",
|
||||
"Playback stopped!",
|
||||
"Queue destroyed! Bot will stay and chill with you in a vc",
|
||||
)
|
||||
.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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user