Only enable Markdown when necessary

This commit is contained in:
FliegendeWurst 2021-08-07 15:06:26 +02:00
parent fc0992c4c8
commit a1371b2948
2 changed files with 6 additions and 1 deletions

View File

@ -78,6 +78,11 @@ pub fn error<S: Into<String>>(msg: S) -> Error {
} }
pub async fn send_message<S: Into<String>>(msg: S) -> Result<(), Error> { pub async fn send_message<S: Into<String>>(msg: S) -> Result<(), Error> {
API.send(SendMessage::new(*OWNER, msg.into()).parse_mode(ParseMode::Html)).await?;
Ok(())
}
pub async fn send_message_markdown<S: Into<String>>(msg: S) -> Result<(), Error> {
API.send(SendMessage::new(*OWNER, msg.into()).parse_mode(ParseMode::MarkdownV2)).await?; API.send(SendMessage::new(*OWNER, msg.into()).parse_mode(ParseMode::MarkdownV2)).await?;
Ok(()) Ok(())
} }

View File

@ -252,7 +252,7 @@ async fn command_next() -> Result<(), Error> {
} }
} }
buf += "```\n"; buf += "```\n";
send_message(buf).await?; send_message_markdown(buf).await?;
Ok(()) Ok(())
} }