Add config dump

This commit is contained in:
Lucy Bladen 2022-07-18 00:49:11 +01:00
parent abdcc07fe2
commit d527b7db0a
Signed by untrusted user who does not match committer: xyon
GPG Key ID: DD18155D6B18078D
1 changed files with 13 additions and 0 deletions

View File

@ -93,6 +93,19 @@ async fn set_config(ctx: &Context, msg: &Message, mut args: Args) -> CommandResu
Ok(()) Ok(())
} }
#[command]
async fn dump_config(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
let data = &ctx.data.read().await;
let config = match data.get::<ManifoldConfig>() {
Some(c) => c.lock().await,
None => Err("Could not lock database!".to_string())?
};
msg.reply_ping(&ctx, format!("Config dump; {:?}", &config.config)).await?;
Ok(())
}
#[command] #[command]
async fn get_environment(ctx: &Context, msg: &Message, _: Args) -> CommandResult { async fn get_environment(ctx: &Context, msg: &Message, _: Args) -> CommandResult {