log more actions + tidy up things

This commit is contained in:
seth 2024-03-03 18:32:44 -05:00
parent 651f14d724
commit 915ef54dc3
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
14 changed files with 56 additions and 19 deletions

View file

@ -1,4 +1,5 @@
use eyre::Result;
use log::trace;
use once_cell::sync::Lazy;
use poise::serenity_prelude::{Context, Message};
use rand::seq::SliceRandom;
@ -6,7 +7,7 @@ use regex::Regex;
static ETA_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"\beta\b").unwrap());
pub const ETA_MESSAGES: [&str; 16] = [
const ETA_MESSAGES: [&str; 16] = [
"Sometime",
"Some day",
"Not far",
@ -27,6 +28,7 @@ pub const ETA_MESSAGES: [&str; 16] = [
pub async fn handle(ctx: &Context, message: &Message) -> Result<()> {
if !ETA_REGEX.is_match(&message.content) {
trace!("The message '{}' (probably) doesn't say ETA", message.content);
return Ok(());
}