diff --git a/src/commands.rs b/src/commands.rs index fc34bf1..03fb430 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -121,11 +121,15 @@ impl Command for GetAllVariablesCommand { async fn execute(&self, ctx: &Context) -> Execution { let value = match ctx.db.get_user_variables(&ctx.room_id, &ctx.username).await { - Ok(variables) => variables - .into_iter() - .map(|(name, value)| format!(" - {} = {}", name, value)) - .collect::>() - .join("\n"), + Ok(variables) => { + let mut variable_list = variables + .into_iter() + .map(|(name, value)| format!(" - {} = {}", name, value)) + .collect::>(); + + variable_list.sort(); + variable_list.join("\n") + } Err(e) => format!("error getting variables: {}", e), };