Remove unused files. Fix compiler warnings. Update help

This commit is contained in:
jude 2022-09-13 10:46:45 +01:00
parent f5acab7440
commit a05d6f77db
13 changed files with 11 additions and 23 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="dataSourceStorageLocal" created-in="CL-222.3345.126"> <component name="dataSourceStorageLocal" created-in="CL-213.7172.20">
<data-source name="MySQL for 5.1 - soundfx@localhost" uuid="1067c1d0-1386-4a39-b3f5-6d48d6f279eb"> <data-source name="MySQL for 5.1 - soundfx@localhost" uuid="1067c1d0-1386-4a39-b3f5-6d48d6f279eb">
<database-info product="" version="" jdbc-version="" driver-name="" driver-version="" dbms="MYSQL" exact-version="0" /> <database-info product="" version="" jdbc-version="" driver-name="" driver-version="" dbms="MYSQL" exact-version="0" />
<secret-storage>master_key</secret-storage> <secret-storage>master_key</secret-storage>

3
Cargo.lock generated
View File

@ -1924,10 +1924,9 @@ dependencies = [
[[package]] [[package]]
name = "soundfx-rs" name = "soundfx-rs"
version = "1.5.1" version = "1.5.2"
dependencies = [ dependencies = [
"dashmap", "dashmap",
"dotenv",
"env_logger", "env_logger",
"lazy_static", "lazy_static",
"log", "log",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "soundfx-rs" name = "soundfx-rs"
version = "1.5.1" version = "1.5.2"
authors = ["jellywx <judesouthworth@pm.me>"] authors = ["jellywx <judesouthworth@pm.me>"]
edition = "2018" edition = "2018"
@ -8,7 +8,6 @@ edition = "2018"
songbird = { version = "0.3", features = ["builtin-queue"] } songbird = { version = "0.3", features = ["builtin-queue"] }
poise = "0.2" poise = "0.2"
sqlx = { version = "0.5", default-features = false, features = ["runtime-tokio-rustls", "macros", "mysql", "bigdecimal"] } 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"] } tokio = { version = "1", features = ["fs", "process", "io-util"] }
lazy_static = "1.4" lazy_static = "1.4"
reqwest = "0.11" reqwest = "0.11"

View File

@ -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"
}

Binary file not shown.

View File

@ -21,6 +21,7 @@ pub async fn help(ctx: Context<'_>) -> Result<(), Error> {
__Play Commands__ __Play Commands__
`/play` - Play a sound by name or ID `/play` - Play a sound by name or ID
`/queue` - Play sounds on queue instead of instantly
`/loop` - Play a sound on loop `/loop` - Play a sound on loop
`/disconnect` - Disconnect the bot `/disconnect` - Disconnect the bot
`/stop` - Stop playback `/stop` - Stop playback
@ -38,7 +39,8 @@ __Search Commands__
`/random` - View random public sounds `/random` - View random public sounds
__Setting Commands__ __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 `/greet enable/disable` - Enable or disable join sounds on this server
`/volume` - Change the volume `/volume` - Change the volume

View File

@ -81,7 +81,7 @@ pub async fn set_guild_greet_sound(
Some(sound) => { Some(sound) => {
ctx.data() ctx.data()
.update_join_sound(user.id, ctx.guild_id(), Some(sound.id)) .update_join_sound(user.id, ctx.guild_id(), Some(sound.id))
.await; .await?;
ctx.say(format!( ctx.say(format!(
"Greet sound has been set to {} (ID {})", "Greet sound has been set to {} (ID {})",
@ -123,7 +123,7 @@ pub async fn unset_guild_greet_sound(
ctx.data() ctx.data()
.update_join_sound(user.id, ctx.guild_id(), None) .update_join_sound(user.id, ctx.guild_id(), None)
.await; .await?;
ctx.say("Greet sound has been unset").await?; ctx.say("Greet sound has been unset").await?;
@ -153,7 +153,7 @@ pub async fn set_user_greet_sound(
Some(sound) => { Some(sound) => {
ctx.data() ctx.data()
.update_join_sound(ctx.author().id, None::<GuildId>, Some(sound.id)) .update_join_sound(ctx.author().id, None::<GuildId>, Some(sound.id))
.await; .await?;
ctx.send(|b| { ctx.send(|b| {
b.ephemeral(true).content(format!( 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> { pub async fn unset_user_greet_sound(ctx: Context<'_>) -> Result<(), Error> {
ctx.data() ctx.data()
.update_join_sound(ctx.author().id, None::<GuildId>, None) .update_join_sound(ctx.author().id, None::<GuildId>, None)
.await; .await?;
ctx.send(|b| b.ephemeral(true).content("Greet sound has been unset")) ctx.send(|b| b.ephemeral(true).content("Greet sound has been unset"))
.await?; .await?;

View File

@ -11,7 +11,6 @@ mod utils;
use std::{env, sync::Arc}; use std::{env, sync::Arc};
use dashmap::DashMap; use dashmap::DashMap;
use dotenv::dotenv;
use poise::serenity::{ use poise::serenity::{
builder::CreateApplicationCommands, builder::CreateApplicationCommands,
model::{ model::{
@ -72,8 +71,6 @@ pub async fn register_application_commands(
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
env_logger::init(); env_logger::init();
dotenv()?;
let discord_token = env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN from environment"); let discord_token = env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN from environment");
let options = poise::FrameworkOptions { let options = poise::FrameworkOptions {
@ -138,9 +135,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
register_application_commands( register_application_commands(
ctx, ctx,
framework, framework,
env::var("DEBUG_GUILD") None,
.map(|inner| GuildId(inner.parse().expect("DEBUG_GUILD not valid")))
.ok(),
) )
.await .await
.unwrap(); .unwrap();