support playing files
parent
7772a39526
commit
fb39392958
11
src/main.rs
11
src/main.rs
|
@ -136,13 +136,18 @@ impl EventHandler for Handler {
|
||||||
SoundType::Youtube => match songbird::ytdl(&user.sound).await {
|
SoundType::Youtube => match songbird::ytdl(&user.sound).await {
|
||||||
Ok(source) => source,
|
Ok(source) => source,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
error!("Error starting source: {err:?}");
|
error!("Error starting youtube source: {err:?}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SoundType::File => {
|
SoundType::File => {
|
||||||
error!("Playing files not supported yet");
|
match songbird::ffmpeg(format!("sounds/{}", &user.sound)).await {
|
||||||
return;
|
Ok(source) => source,
|
||||||
|
Err(err) => {
|
||||||
|
error!("Error starting file source: {err:?}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue