mirror of
https://github.com/FliegendeWurst/telegram_notes_bot.git
synced 2024-11-08 13:20:37 +00:00
Only enable Markdown when necessary
This commit is contained in:
parent
fc0992c4c8
commit
a1371b2948
@ -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(())
|
||||||
}
|
}
|
||||||
|
@ -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(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user