From a32e477bf6cd86b97e3019352635bf10f048657d Mon Sep 17 00:00:00 2001 From: Byte Dice Date: Thu, 20 Mar 2025 20:36:35 +0100 Subject: [PATCH] fixed so config now updates properly --- TODO.md | 1 + data/discord_data_preset.json | 3 ++- src/cmds.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 4c6a8d1..65d324e 100644 --- a/TODO.md +++ b/TODO.md @@ -9,6 +9,7 @@ + - [ ] Allow disabling bk_week - [ ] Language files? - [ ] Allow updating the data autonomously and via manual commands. diff --git a/data/discord_data_preset.json b/data/discord_data_preset.json index cf97f26..47bc7fb 100644 --- a/data/discord_data_preset.json +++ b/data/discord_data_preset.json @@ -6,7 +6,8 @@ "bk_mods": [ "USER ID 1", "USER ID 2" - ] + ], + "bk_week_disabled": false } } } \ No newline at end of file diff --git a/src/cmds.rs b/src/cmds.rs index e4265f5..bf9ec13 100644 --- a/src/cmds.rs +++ b/src/cmds.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::process; use std::error::Error as StdErr; -use crate::data::{dc_add_server, get_mutex_data}; +use crate::data::{dc_add_server, get_mutex_data, read_cfg_data}; use crate::websocket::send_cmd_json; use crate::{data, Context, Data, Error}; use crate::messages::{edit_reply, send_embed, send_msg, Author, EmbedOptions, MANDATORY_MSG}; @@ -255,6 +255,7 @@ pub async fn reload_cfg( ctx: Context<'_> ) -> Result<(), Error> { + read_cfg_data(&ctx.data(), false).await; let d = get_mutex_data(&ctx.data().cfg).await?; let d_str = serde_json::to_string(&d)?; let r = send_cmd_json("update_cfg", Some(json!([d_str]))).await;