diff options
| author | seth <[email protected]> | 2023-09-03 14:59:38 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-09-03 15:18:59 -0400 |
| commit | 41a17b7b3757351d3679093c075acc08a72a8bf0 (patch) | |
| tree | 36d3758260ea259b51ead2e0e17f57bea5d895df /src | |
| parent | 5d63f4b750a5982724982c302c66294552b1fe9c (diff) | |
fix: don't use regex for moyai
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 1 insertions, 5 deletions
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<Regex> = - Lazy::new(|| Regex::new(r"^<a?:\w*moy?ai\w*:\d+>$").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") |
