From 815cb0df3b3e3f9dd2078b00f85754da87b1d55e Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 5 Dec 2023 05:17:49 -0500 Subject: refactor: centralize storage handlers --- src/commands/optional/teawiespam.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/commands/optional/teawiespam.rs') diff --git a/src/commands/optional/teawiespam.rs b/src/commands/optional/teawiespam.rs index c1b3b29..bb8f32d 100644 --- a/src/commands/optional/teawiespam.rs +++ b/src/commands/optional/teawiespam.rs @@ -1,4 +1,4 @@ -use crate::{Context, Settings}; +use crate::Context; use color_eyre::eyre::Result; use log::*; @@ -6,8 +6,10 @@ 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 = Settings::from_redis(&ctx.data().redis, &gid).await?; + let settings = ctx.data().storage.get_guild_settings(&gid).await?; if !settings.optional_commands_enabled { debug!("Not running teawiespam in {gid} since it's disabled"); -- cgit v1.2.3