major update thingy. Clippy is happy, bugfixes, new "max_results" arg to /re_updateDiscord, etc.

This commit is contained in:
2025-08-09 14:37:15 +02:00
parent b4044956de
commit 0db5937c39
17 changed files with 97 additions and 86 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ fn separate_by_category(cmds: Vec<&Cmd>) -> Vec<(String, Vec<&Cmd>)> {
for cmd in cmds {
grouped
.entry(cmd.category.clone().unwrap_or("No category".to_string()))
.or_insert_with(Vec::new).push(cmd);
.or_default().push(cmd);
}
return grouped.into_iter().collect();
+1 -1
View File
@@ -14,7 +14,7 @@ pub async fn cmd(
ctx: Context<'_>
) -> Result<(), Error>
{
let r = read_cfg_data(&ctx.data(), false).await;
let r = read_cfg_data(ctx.data(), false).await;
let d = get_toml_mutex(&ctx.data().cfg).await.unwrap();
if r.is_none() { return Ok(()); }
+3 -2
View File
@@ -19,8 +19,9 @@ pub async fn cmd(
#[description = "Type \"i want to stop the bot now\" to confirm."] confirmation: Option<String>,
) -> Result<(), Error>
{
let should_stop = ctx.data().args.dev
|| confirmation.unwrap_or_default().to_lowercase() == "i want to stop the bot now";
let stop_confirm = "i want to stop the bot now".replace(" ", "");
let confirm_formatted = confirmation.unwrap_or_default().to_lowercase().replace(" ", "");
let should_stop = ctx.data().args.dev || confirm_formatted == stop_confirm;
if should_stop {
let msg = send_msg(ctx, lang!("dc_msg_owner_data_save"), true, true).await.unwrap();