From fb393929581d1ec4bb152c868da6d7b05ef59e6b Mon Sep 17 00:00:00 2001 From: Patrick Cleavelin Date: Sun, 12 Feb 2023 19:41:01 -0600 Subject: [PATCH] support playing files --- src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index f0040d6..0f19771 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,13 +136,18 @@ impl EventHandler for Handler { SoundType::Youtube => match songbird::ytdl(&user.sound).await { Ok(source) => source, Err(err) => { - error!("Error starting source: {err:?}"); + error!("Error starting youtube source: {err:?}"); return; } }, SoundType::File => { - error!("Playing files not supported yet"); - return; + match songbird::ffmpeg(format!("sounds/{}", &user.sound)).await { + Ok(source) => source, + Err(err) => { + error!("Error starting file source: {err:?}"); + return; + } + } } };