Skip to content

Commit

Permalink
fix: format message to send
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed May 28, 2024
1 parent 7f5f635 commit b03249c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cangrebot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ use crate::EventDateType;

const THREE_DAYS: &str = r#"@announce@
@anuncios
@description@@date@
@hour@
@location@@link@"#;
Expand Down Expand Up @@ -74,13 +72,13 @@ pub async fn build_message(
.expect(&format!("Cannot parse date {}", e.start.date_time))
.unix_timestamp();
let msg = THREE_DAYS
.replace("@announce@", "📢 ¡Este martes 2 de abril!")
.replace("@announce@", "📢 ¡Atencion @anuncios !")
.replace("@title@", &format!("**{}**", e.summary))
.replace(
"@description@",
&e.description
.clone()
.map(|d| format!("{}\n", html_to_md(&d)))
.map(|d| format!("{}\n\n", html_to_md(&d)))
.unwrap_or_default(),
)
.replace("@date@", &format!("📅 Fecha: <t:{timestamp}:D>"))
Expand Down

0 comments on commit b03249c

Please sign in to comment.