diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index 3a1e9e9..f75abdd 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + master_key diff --git a/Cargo.lock b/Cargo.lock index 527c2e2..2f9bb86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1924,10 +1924,9 @@ dependencies = [ [[package]] name = "soundfx-rs" -version = "1.5.1" +version = "1.5.2" dependencies = [ "dashmap", - "dotenv", "env_logger", "lazy_static", "log", diff --git a/Cargo.toml b/Cargo.toml index 08e4b37..08d5f3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soundfx-rs" -version = "1.5.1" +version = "1.5.2" authors = ["jellywx "] edition = "2018" @@ -8,7 +8,6 @@ edition = "2018" songbird = { version = "0.3", features = ["builtin-queue"] } poise = "0.2" sqlx = { version = "0.5", default-features = false, features = ["runtime-tokio-rustls", "macros", "mysql", "bigdecimal"] } -dotenv = "0.15" tokio = { version = "1", features = ["fs", "process", "io-util"] } lazy_static = "1.4" reqwest = "0.11" diff --git a/audio/243627__lebaston100__heavy-rain.wav b/audio/243627__lebaston100__heavy-rain.wav deleted file mode 100644 index 0e31b46..0000000 Binary files a/audio/243627__lebaston100__heavy-rain.wav and /dev/null differ diff --git a/audio/346642__inspectorj__rain-on-windows-interior-a.wav b/audio/346642__inspectorj__rain-on-windows-interior-a.wav deleted file mode 100644 index 8e2a6f2..0000000 Binary files a/audio/346642__inspectorj__rain-on-windows-interior-a.wav and /dev/null differ diff --git a/audio/400632__inspectorj__ambience-seaside-waves-close-a.wav b/audio/400632__inspectorj__ambience-seaside-waves-close-a.wav deleted file mode 100644 index b330177..0000000 Binary files a/audio/400632__inspectorj__ambience-seaside-waves-close-a.wav and /dev/null differ diff --git a/audio/459407__pfannkuchn__small-river-1-fast-close.wav b/audio/459407__pfannkuchn__small-river-1-fast-close.wav deleted file mode 100644 index 2932a08..0000000 Binary files a/audio/459407__pfannkuchn__small-river-1-fast-close.wav and /dev/null differ diff --git a/audio/531947__straget__the-rain-falls-against-the-parasol.wav b/audio/531947__straget__the-rain-falls-against-the-parasol.wav deleted file mode 100644 index 693f96f..0000000 Binary files a/audio/531947__straget__the-rain-falls-against-the-parasol.wav and /dev/null differ diff --git a/audio/audio.json b/audio/audio.json deleted file mode 100644 index e08b732..0000000 --- a/audio/audio.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "heavy rain": "243627__lebaston100__heavy-rain.wav", - "rain on window": "rain-on-windows-cropped.wav", - "rain on tent": "531947__straget__the-rain-falls-against-the-parasol.wav", - "waves": "400632__inspectorj__ambience-seaside-waves-close-a.wav", - "river": "459407__pfannkuchn__small-river-1-fast-close.wav" -} diff --git a/audio/rain-on-windows-cropped.wav b/audio/rain-on-windows-cropped.wav deleted file mode 100644 index df5f2e8..0000000 Binary files a/audio/rain-on-windows-cropped.wav and /dev/null differ diff --git a/src/cmds/info.rs b/src/cmds/info.rs index 2d97a17..5461173 100644 --- a/src/cmds/info.rs +++ b/src/cmds/info.rs @@ -21,6 +21,7 @@ pub async fn help(ctx: Context<'_>) -> Result<(), Error> { __Play Commands__ `/play` - Play a sound by name or ID +`/queue` - Play sounds on queue instead of instantly `/loop` - Play a sound on loop `/disconnect` - Disconnect the bot `/stop` - Stop playback @@ -38,7 +39,8 @@ __Search Commands__ `/random` - View random public sounds __Setting Commands__ -`/greet set/unset` - Set or unset a join sound +`/greet server set/unset` - Set or unset a join sound for just this server +`/greet user set/unset` - Set or unset a join sound across all servers `/greet enable/disable` - Enable or disable join sounds on this server `/volume` - Change the volume diff --git a/src/cmds/settings.rs b/src/cmds/settings.rs index 2b8afef..d54e10e 100644 --- a/src/cmds/settings.rs +++ b/src/cmds/settings.rs @@ -81,7 +81,7 @@ pub async fn set_guild_greet_sound( Some(sound) => { ctx.data() .update_join_sound(user.id, ctx.guild_id(), Some(sound.id)) - .await; + .await?; ctx.say(format!( "Greet sound has been set to {} (ID {})", @@ -123,7 +123,7 @@ pub async fn unset_guild_greet_sound( ctx.data() .update_join_sound(user.id, ctx.guild_id(), None) - .await; + .await?; ctx.say("Greet sound has been unset").await?; @@ -153,7 +153,7 @@ pub async fn set_user_greet_sound( Some(sound) => { ctx.data() .update_join_sound(ctx.author().id, None::, Some(sound.id)) - .await; + .await?; ctx.send(|b| { b.ephemeral(true).content(format!( @@ -181,7 +181,7 @@ pub async fn set_user_greet_sound( pub async fn unset_user_greet_sound(ctx: Context<'_>) -> Result<(), Error> { ctx.data() .update_join_sound(ctx.author().id, None::, None) - .await; + .await?; ctx.send(|b| b.ephemeral(true).content("Greet sound has been unset")) .await?; diff --git a/src/main.rs b/src/main.rs index f205d0e..ba05610 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,6 @@ mod utils; use std::{env, sync::Arc}; use dashmap::DashMap; -use dotenv::dotenv; use poise::serenity::{ builder::CreateApplicationCommands, model::{ @@ -72,8 +71,6 @@ pub async fn register_application_commands( async fn main() -> Result<(), Box> { env_logger::init(); - dotenv()?; - let discord_token = env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN from environment"); let options = poise::FrameworkOptions { @@ -138,9 +135,7 @@ async fn main() -> Result<(), Box> { register_application_commands( ctx, framework, - env::var("DEBUG_GUILD") - .map(|inner| GuildId(inner.parse().expect("DEBUG_GUILD not valid"))) - .ok(), + None, ) .await .unwrap();