summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock39
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs6
3 files changed, 1 insertions, 45 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c907498..092c7b1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -18,15 +18,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
-name = "aho-corasick"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04"
-dependencies = [
- "memchr",
-]
-
-[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1015,35 +1006,6 @@ dependencies = [
]
[[package]]
-name = "regex"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-automata",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
-
-[[package]]
name = "reqwest"
version = "0.11.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1365,7 +1327,6 @@ dependencies = [
"include_dir",
"once_cell",
"rand 0.8.5",
- "regex",
"reqwest",
"serde",
"serenity",
diff --git a/Cargo.toml b/Cargo.toml
index f00c297..a287dd2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,6 @@ bottomify = "1.2.0"
include_dir = "0.7.3"
once_cell = "1.18.0"
rand = "0.8.5"
-regex = "1.9.4"
reqwest = { version = "0.11.20", default-features = false, features = ["rustls-tls", "json"] }
serde = "1.0.188"
serenity = "0.11.6"
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")