|
@@ -2,19 +2,15 @@ use std::{
|
|
sync::Arc,
|
|
sync::Arc,
|
|
collections::HashMap,
|
|
collections::HashMap,
|
|
};
|
|
};
|
|
-use rspotify::model::idtypes::Track;
|
|
|
|
use serenity::{
|
|
use serenity::{
|
|
client::Context,
|
|
client::Context,
|
|
framework::standard::{
|
|
framework::standard::{
|
|
Args, CommandResult,
|
|
Args, CommandResult,
|
|
macros::{command, group},
|
|
macros::{command, group},
|
|
},
|
|
},
|
|
- http::Http, model::{channel::Message, id::{ChannelId, GuildId}}
|
|
|
|
-};
|
|
|
|
-use songbird::tracks::{
|
|
|
|
- TrackHandle,
|
|
|
|
- TrackCommand,
|
|
|
|
|
|
+ model::{channel::Message, id::GuildId}
|
|
};
|
|
};
|
|
|
|
+use songbird::tracks::TrackCommand;
|
|
use tokio::{
|
|
use tokio::{
|
|
sync::Mutex,
|
|
sync::Mutex,
|
|
};
|
|
};
|
|
@@ -30,7 +26,7 @@ use crate::util::{
|
|
};
|
|
};
|
|
|
|
|
|
#[group]
|
|
#[group]
|
|
-#[commands(join,play,skip,pause,resume,shuffle,clear,splay,queue)]
|
|
|
|
|
|
+#[commands(join,disconnect,play,skip,pause,resume,shuffle,clear,splay,queue)]
|
|
struct Audio;
|
|
struct Audio;
|
|
|
|
|
|
lazy_static! {
|
|
lazy_static! {
|
|
@@ -63,7 +59,7 @@ async fn get_audio_state(ctx: &Context, msg: &Message) -> Option<Arc<AudioState>
|
|
};
|
|
};
|
|
let manager = songbird::get(ctx)
|
|
let manager = songbird::get(ctx)
|
|
.await
|
|
.await
|
|
- .expect("Err get_audio_state: Songbird not initialized")
|
|
|
|
|
|
+ .unwrap()
|
|
.clone();
|
|
.clone();
|
|
let (handle_lock, success) = manager.join(guild_id, channel_id).await;
|
|
let (handle_lock, success) = manager.join(guild_id, channel_id).await;
|
|
if let Err(err) = success{
|
|
if let Err(err) = success{
|