Skip to content

Commit

Permalink
feat(inclusion_monitor): send HTML version also
Browse files Browse the repository at this point in the history
  • Loading branch information
alextes committed Feb 8, 2024
1 parent d841c96 commit e171a7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/phoenix/inclusion_monitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,13 @@ async fn report_missing_payload(
}

if publish_errors.is_empty() && late_call_stats.is_some() {
send_telegram_warning(&message).await
send_telegram_warning(&message, "MarkdownV2").await?;
send_telegram_warning(&message, "HTML").await?;
} else {
send_telegram_alert(&message).await
send_telegram_alert(&message).await?;
}

Ok(())
}

async fn check_missing_payload(
Expand Down
4 changes: 2 additions & 2 deletions src/phoenix/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn escape_code_block(input: &str) -> String {

/// Sends a message to the Telegram warnings channel.
/// Make sure the message is escaped.
pub async fn send_telegram_warning(message: &str) -> anyhow::Result<()> {
pub async fn send_telegram_warning(message: &str, parse_mode: &str) -> anyhow::Result<()> {
let url = format!(
"https://api.telegram.org/bot{}/sendMessage",
&APP_CONFIG.telegram_api_key
Expand All @@ -49,7 +49,7 @@ pub async fn send_telegram_warning(message: &str) -> anyhow::Result<()> {
.query(&[
("chat_id", APP_CONFIG.telegram_warnings_channel_id.as_str()),
("text", message),
("parse_mode", "MarkdownV2"),
("parse_mode", parse_mode),
("disable_web_page_preview", "true"),
])
.send()
Expand Down

0 comments on commit e171a7b

Please sign in to comment.