major update thingy. Clippy is happy, bugfixes, new "max_results" arg to /re_updateDiscord, etc.
This commit is contained in:
+1
-1
@@ -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();
|
||||
|
||||
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user