parent
c10ee5c0f3
commit
7f971703e2
|
@ -121,11 +121,15 @@ impl Command for GetAllVariablesCommand {
|
||||||
|
|
||||||
async fn execute(&self, ctx: &Context) -> Execution {
|
async fn execute(&self, ctx: &Context) -> Execution {
|
||||||
let value = match ctx.db.get_user_variables(&ctx.room_id, &ctx.username).await {
|
let value = match ctx.db.get_user_variables(&ctx.room_id, &ctx.username).await {
|
||||||
Ok(variables) => variables
|
Ok(variables) => {
|
||||||
|
let mut variable_list = variables
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(name, value)| format!(" - {} = {}", name, value))
|
.map(|(name, value)| format!(" - {} = {}", name, value))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>();
|
||||||
.join("\n"),
|
|
||||||
|
variable_list.sort();
|
||||||
|
variable_list.join("\n")
|
||||||
|
}
|
||||||
Err(e) => format!("error getting variables: {}", e),
|
Err(e) => format!("error getting variables: {}", e),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue