Add config dump
This commit is contained in:
parent
abdcc07fe2
commit
d527b7db0a
|
|
@ -93,6 +93,19 @@ async fn set_config(ctx: &Context, msg: &Message, mut args: Args) -> CommandResu
|
|||
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]
|
||||
async fn get_environment(ctx: &Context, msg: &Message, _: Args) -> CommandResult {
|
||||
|
|
|
|||
Loading…
Reference in New Issue