From 2096af2512c0ec5147be06a687f1c10a667f4ad0 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Thu, 13 May 2021 22:31:38 +0000 Subject: [PATCH] Show username pill when executing multiple commands. --- src/bot.rs | 5 +++++ src/commands.rs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bot.rs b/src/bot.rs index a0f3b45..b3d8531 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -73,6 +73,11 @@ async fn handle_multiple_results( respond_to: &str, room: &Joined, ) { + let respond_to = format!( + "{}", + respond_to, respond_to + ); + let errors: Vec<(&str, &ExecutionError)> = results .into_iter() .filter_map(|(cmd, result)| match result { diff --git a/src/commands.rs b/src/commands.rs index daa5663..9e4b7a1 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -76,11 +76,13 @@ pub trait ResponseExtractor { impl ResponseExtractor for ExecutionResult { /// Error message in bolded HTML. fn message_html(&self, username: &str) -> String { - //TODO use user display name too + // TODO use user display name too (element seems to render this + // without display name) let username = format!( "{}", username, username ); + match self { Ok(resp) => format!("

{}

{}

", username, resp.html).replace("\n", "
"), Err(e) => format!("

{}

{}

", username, e.html()).replace("\n", "
"),