Add join sound
This commit is contained in:
parent
362dfeeb9d
commit
d1edef3623
|
@ -5,3 +5,4 @@ Cargo.lock
|
||||||
Conf.toml
|
Conf.toml
|
||||||
/data
|
/data
|
||||||
/log
|
/log
|
||||||
|
join_audio.mp3
|
|
@ -24,4 +24,4 @@ serde_json = "1.0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
log4rs = "1.0"
|
log4rs = "1.0"
|
||||||
ctrlc = "3.1"
|
ctrlc = "3.1"
|
||||||
songbird = { version = "0.1", features = ["driver", "builtin-queue"], optional = true }
|
songbird = { version = "0.1.6", features = ["driver", "builtin-queue"], optional = true }
|
|
@ -127,6 +127,16 @@ async fn join(ctx: &Context, msg: &Message) -> CommandResult {
|
||||||
|
|
||||||
if success.is_ok() {
|
if success.is_ok() {
|
||||||
let mut handler = handler_lock.lock().await;
|
let mut handler = handler_lock.lock().await;
|
||||||
|
|
||||||
|
match songbird::ffmpeg("join_audio.mp3").await {
|
||||||
|
Ok(input) => {
|
||||||
|
handler.enqueue_source(input);
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
error!("Failed to load join sound : {:?}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handler.add_global_event(
|
handler.add_global_event(
|
||||||
Event::Track(TrackEvent::Play),
|
Event::Track(TrackEvent::Play),
|
||||||
TrackStartNotifier {
|
TrackStartNotifier {
|
||||||
|
|
Loading…
Reference in New Issue