diff options
Diffstat (limited to 'src/commands')
| -rw-r--r-- | src/commands/moderation/config.rs | 5 | ||||
| -rw-r--r-- | src/commands/optional/copypasta.rs | 8 | ||||
| -rw-r--r-- | src/commands/optional/teawiespam.rs | 2 |
3 files changed, 6 insertions, 9 deletions
diff --git a/src/commands/moderation/config.rs b/src/commands/moderation/config.rs index 967e585..64cdb83 100644 --- a/src/commands/moderation/config.rs +++ b/src/commands/moderation/config.rs @@ -1,8 +1,7 @@ use std::str::FromStr; use crate::{storage, Context}; -use settings::{Settings, SettingsProperties}; -use storage::settings; +use storage::{Settings, SettingsProperties}; use color_eyre::eyre::{eyre, Result}; use log::*; @@ -125,7 +124,7 @@ pub async fn set( if previous_settings != settings { debug!("Updating settings key for {gid}"); - storage.create_settings_key(settings).await?; + storage.create_guild_settings(settings).await?; ctx.reply("Configuration updated!").await?; } else { debug!("Not updating settings key for {gid} since no changes were made"); diff --git a/src/commands/optional/copypasta.rs b/src/commands/optional/copypasta.rs index 289a936..54b6194 100644 --- a/src/commands/optional/copypasta.rs +++ b/src/commands/optional/copypasta.rs @@ -41,13 +41,13 @@ fn get_copypasta(name: Copypastas) -> Result<String> { let name = file .path() .file_stem() - .ok_or_else(|| eyre!("couldn't get file stem from {file:#?}"))? + .ok_or_else(|| eyre!("Couldn't get file stem from {file:#?}"))? .to_str() - .ok_or_else(|| eyre!("couldn't convert file stem to str!"))?; + .ok_or_else(|| eyre!("Couldn't convert file stem to str!"))?; let contents = file .contents_utf8() - .ok_or_else(|| eyre!("couldnt get contents from copypasta!"))?; + .ok_or_else(|| eyre!("Couldnt get contents from copypasta!"))?; // refer to files by their name w/o extension files.insert(name, contents); @@ -56,7 +56,7 @@ fn get_copypasta(name: Copypastas) -> Result<String> { if files.contains_key(name.as_str()) { Ok(files[name.as_str()].to_string()) } else { - Err(eyre!("couldnt find copypasta {name}!")) + Err(eyre!("Couldnt find copypasta {name}!")) } } diff --git a/src/commands/optional/teawiespam.rs b/src/commands/optional/teawiespam.rs index bb8f32d..a876d09 100644 --- a/src/commands/optional/teawiespam.rs +++ b/src/commands/optional/teawiespam.rs @@ -6,8 +6,6 @@ use log::*; /// teawie will spam you. #[poise::command(slash_command, prefix_command)] pub async fn teawiespam(ctx: Context<'_>) -> Result<()> { - debug!("Running teawiespam command"); - let gid = ctx.guild_id().unwrap_or_default(); let settings = ctx.data().storage.get_guild_settings(&gid).await?; |
