fixed so config now updates properly
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
<!-- - [x] Some kind of voting system. -->
|
<!-- - [x] Some kind of voting system. -->
|
||||||
<!-- - [x] ~~`/bk_week_top [category] [amount]` to get the top N posts in a category (e.g upvotes)~~ -->
|
<!-- - [x] ~~`/bk_week_top [category] [amount]` to get the top N posts in a category (e.g upvotes)~~ -->
|
||||||
<!-- - [x] ~~`/bk_cfg_sr [subreddit]` to change the target subreddit(s)~~ -->
|
<!-- - [x] ~~`/bk_cfg_sr [subreddit]` to change the target subreddit(s)~~ -->
|
||||||
|
- [ ] Allow disabling bk_week
|
||||||
- [ ] Language files?
|
- [ ] Language files?
|
||||||
- [ ] Allow updating the data autonomously and via manual commands.
|
- [ ] Allow updating the data autonomously and via manual commands.
|
||||||
<!-- - [ ] 10-minute schedule for updating Discord channel (IMPOSSIBLE / REALLY FUCKING HARD) -->
|
<!-- - [ ] 10-minute schedule for updating Discord channel (IMPOSSIBLE / REALLY FUCKING HARD) -->
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
"bk_mods": [
|
"bk_mods": [
|
||||||
"USER ID 1",
|
"USER ID 1",
|
||||||
"USER ID 2"
|
"USER ID 2"
|
||||||
]
|
],
|
||||||
|
"bk_week_disabled": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-1
@@ -2,7 +2,7 @@ use std::collections::HashMap;
|
|||||||
use std::process;
|
use std::process;
|
||||||
use std::error::Error as StdErr;
|
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::websocket::send_cmd_json;
|
||||||
use crate::{data, Context, Data, Error};
|
use crate::{data, Context, Data, Error};
|
||||||
use crate::messages::{edit_reply, send_embed, send_msg, Author, EmbedOptions, MANDATORY_MSG};
|
use crate::messages::{edit_reply, send_embed, send_msg, Author, EmbedOptions, MANDATORY_MSG};
|
||||||
@@ -255,6 +255,7 @@ pub async fn reload_cfg(
|
|||||||
ctx: Context<'_>
|
ctx: Context<'_>
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>
|
||||||
{
|
{
|
||||||
|
read_cfg_data(&ctx.data(), false).await;
|
||||||
let d = get_mutex_data(&ctx.data().cfg).await?;
|
let d = get_mutex_data(&ctx.data().cfg).await?;
|
||||||
let d_str = serde_json::to_string(&d)?;
|
let d_str = serde_json::to_string(&d)?;
|
||||||
let r = send_cmd_json("update_cfg", Some(json!([d_str]))).await;
|
let r = send_cmd_json("update_cfg", Some(json!([d_str]))).await;
|
||||||
|
|||||||
Reference in New Issue
Block a user