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) => {
|
||||||
.into_iter()
|
let mut variable_list = variables
|
||||||
.map(|(name, value)| format!(" - {} = {}", name, value))
|
.into_iter()
|
||||||
.collect::<Vec<_>>()
|
.map(|(name, value)| format!(" - {} = {}", name, value))
|
||||||
.join("\n"),
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
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