From a1371b2948e7f8f20a190ee23bad4a373f9d8715 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Sat, 7 Aug 2021 15:06:26 +0200 Subject: [PATCH] Only enable Markdown when necessary --- src/lib.rs | 5 +++++ src/main.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index bbecfad..330a91a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,6 +78,11 @@ pub fn error>(msg: S) -> Error { } pub async fn send_message>(msg: S) -> Result<(), Error> { + API.send(SendMessage::new(*OWNER, msg.into()).parse_mode(ParseMode::Html)).await?; + Ok(()) +} + +pub async fn send_message_markdown>(msg: S) -> Result<(), Error> { API.send(SendMessage::new(*OWNER, msg.into()).parse_mode(ParseMode::MarkdownV2)).await?; Ok(()) } diff --git a/src/main.rs b/src/main.rs index 514481a..ac6c7d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -252,7 +252,7 @@ async fn command_next() -> Result<(), Error> { } } buf += "```\n"; - send_message(buf).await?; + send_message_markdown(buf).await?; Ok(()) }