|
@@ -15,18 +15,7 @@ use tokio::sync::Mutex;
|
|
|
use crate::util::{message_react, send_embed};
|
|
|
|
|
|
#[group]
|
|
|
-#[commands(
|
|
|
- join,
|
|
|
- disconnect,
|
|
|
- play,
|
|
|
- skip,
|
|
|
- pause,
|
|
|
- resume,
|
|
|
- change_loop,
|
|
|
- shuffle,
|
|
|
- clear,
|
|
|
- queue
|
|
|
-)]
|
|
|
+#[commands(join, disconnect, play, skip, pause, resume, clear, queue)]
|
|
|
struct Audio;
|
|
|
|
|
|
lazy_static! {
|
|
@@ -209,22 +198,6 @@ async fn resume(ctx: &Context, msg: &Message) -> CommandResult {
|
|
|
Ok(())
|
|
|
}
|
|
|
|
|
|
-#[command]
|
|
|
-async fn shuffle(ctx: &Context, msg: &Message) -> CommandResult {
|
|
|
- let audio_state = get_audio_state(ctx, msg).await;
|
|
|
- let audio_state = match audio_state {
|
|
|
- Some(audio_state) => audio_state,
|
|
|
- None => return Ok(()),
|
|
|
- };
|
|
|
-
|
|
|
- if let Err(why) = AudioState::shuffle(audio_state).await {
|
|
|
- send_embed(ctx, msg, &format!("Error: {}", why)).await;
|
|
|
- } else {
|
|
|
- message_react(ctx, msg, "🔀").await;
|
|
|
- };
|
|
|
- Ok(())
|
|
|
-}
|
|
|
-
|
|
|
#[command]
|
|
|
async fn clear(ctx: &Context, msg: &Message) -> CommandResult {
|
|
|
let audio_state = get_audio_state(ctx, msg).await;
|
|
@@ -242,23 +215,6 @@ async fn clear(ctx: &Context, msg: &Message) -> CommandResult {
|
|
|
Ok(())
|
|
|
}
|
|
|
|
|
|
-#[command]
|
|
|
-#[aliases("loop")]
|
|
|
-async fn change_loop(ctx: &Context, msg: &Message) -> CommandResult {
|
|
|
- let audio_state = get_audio_state(ctx, msg).await;
|
|
|
- let audio_state = match audio_state {
|
|
|
- Some(audio_state) => audio_state,
|
|
|
- None => return Ok(()),
|
|
|
- };
|
|
|
-
|
|
|
- match AudioState::change_looping(audio_state).await {
|
|
|
- Ok(true) => message_react(ctx, msg, "🔄").await,
|
|
|
- Ok(false) => message_react(ctx, msg, "➡").await,
|
|
|
- Err(why) => send_embed(ctx, msg, &format!("Error: {}", why)).await,
|
|
|
- };
|
|
|
- Ok(())
|
|
|
-}
|
|
|
-
|
|
|
#[command]
|
|
|
async fn queue(ctx: &Context, msg: &Message) -> CommandResult {
|
|
|
let audio_state = get_audio_state(ctx, msg).await;
|