silly goober bot

feat: blahaj bomb?

+7 -3
+7 -3
src/event_handler/blahaj_is_this_true.rs
··· 19 19 pub async fn handle(ctx: &Context, event: &FullEvent, _data: &Data) -> Result<()> { 20 20 if let FullEvent::Message { new_message } = event { 21 21 if new_message.mentions_user(&ctx.cache.current_user()) { 22 - let regex = Regex::new(r"is this true(\?)?").unwrap(); 23 - if regex.is_match(&new_message.content) { 22 + let is_this = Regex::new(r"is this true(\?)?").unwrap(); 23 + if is_this.is_match(&new_message.content) { 24 24 let select = rand::rng().random_range(0..=REPLIES.len()); 25 25 let response = REPLIES[select]; 26 + let _ = new_message.reply(&ctx.http, response).await; 27 + } 26 28 27 - // Reply with the response 29 + let bomb = Regex::new(r"how.(to|do).*bomb").unwrap(); 30 + if bomb.is_match(&new_message.content) { 31 + let response = "very carefully"; 28 32 let _ = new_message.reply(&ctx.http, response).await; 29 33 } 30 34 }