Update to serenity 12

This commit is contained in:
jude
2023-12-18 19:06:18 +00:00
parent cd5651c7f6
commit e632f55b4e
14 changed files with 1669 additions and 1116 deletions
+4 -6
View File
@@ -1,7 +1,7 @@
use std::{env, path::Path};
use poise::serenity_prelude::async_trait;
use songbird::input::restartable::Restartable;
use songbird::input::Input;
use sqlx::Executor;
use tokio::{fs::File, io::AsyncWriteExt, process::Command};
@@ -426,7 +426,7 @@ impl Sound {
) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
let caching_location = env::var("CACHING_LOCATION").unwrap_or(String::from("/tmp"));
let path_name = format!("{}/sound-{}", caching_location, self.id);
let path_name = format!("{}/sound-{}.opus", caching_location, self.id);
let path = Path::new(&path_name);
if !path.exists() {
@@ -441,12 +441,10 @@ impl Sound {
pub async fn playable(
&self,
db_pool: impl Executor<'_, Database = Database>,
) -> Result<Restartable, Box<dyn std::error::Error + Send + Sync>> {
) -> Result<Input, Box<dyn std::error::Error + Send + Sync>> {
let path_name = self.store_sound_source(db_pool).await?;
Ok(Restartable::ffmpeg(path_name, false)
.await
.expect("FFMPEG ERROR!"))
Ok(Input::from(path_name))
}
pub async fn count_user_sounds<U: Into<u64>>(