Improve additional command outputs containing codeblocks.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-19 01:55:21 +00:00
parent 3b34e72456
commit 2f84bc895d
9 changed files with 40 additions and 128 deletions

View file

@ -103,9 +103,7 @@ async fn process_admin_message(msg: String) -> RoomMessageEventContent {
Ok(reply_message) => reply_message,
Err(error) => {
let markdown_message = format!("Encountered an error while handling the command:\n```\n{error}\n```",);
let html_message = format!("Encountered an error while handling the command:\n<pre>\n{error}\n</pre>",);
RoomMessageEventContent::text_html(markdown_message, html_message)
RoomMessageEventContent::notice_markdown(markdown_message)
},
}
}