From 41a17b7b3757351d3679093c075acc08a72a8bf0 Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 3 Sep 2023 14:59:38 -0400 Subject: fix: don't use regex for moyai --- src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index a3e165e..8a3aa94 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ use once_cell::sync::Lazy; -use regex::Regex; use serenity::async_trait; use serenity::framework::standard::macros::{command, group}; use serenity::framework::standard::{CommandResult, StandardFramework}; @@ -48,9 +47,6 @@ impl Handler { Self { bot, pin_board } } fn should_echo(&self, msg: &Message) -> bool { - static MOYAI_REGEX: Lazy = - Lazy::new(|| Regex::new(r"^$").unwrap()); - // Don't echo to anything we posted ourselves, and don't echo at all unless on certain // servers if msg.author.id == self.bot || !is_guild_allowed(msg.guild_id.unwrap_or_default()) { @@ -61,7 +57,7 @@ impl Handler { content == "🗿" || consts::TEAMOJIS.contains(&content.as_str()) - || MOYAI_REGEX.is_match(content) + || content.to_ascii_lowercase() == "moyai" || content .to_ascii_lowercase() .contains("twitter's recommendation algorithm") -- cgit v1.2.3