html terminal
filter admin chats
bendn 2023-12-28
parent 539d994 · commit 60578bd
-rw-r--r--src/webhook.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webhook.rs b/src/webhook.rs
index f7ea620..e19825a 100644
--- a/src/webhook.rs
+++ b/src/webhook.rs
@@ -115,6 +115,7 @@ pub enum Message {
Join { player: String },
Left { player: String },
Chat { player: String, content: String },
+ AdminChat { player: String, content: String },
Load { map: String },
}
@@ -143,6 +144,12 @@ fn get(line: &str) -> Option<Message> {
let u = u.trim_start_matches('<');
let c = c.trim_end_matches('>');
if !(u.is_empty() || c.is_empty() || HAS_UUID.is_match(c) || HAS_UUID.is_match(u)) {
+ if c.starts_with("/a") {
+ return Some(Message::AdminChat {
+ player: unify(u),
+ content: unify(&emoji::mindustry::to_discord(c)),
+ });
+ }
return Some(Message::Chat {
player: unify(u),
content: unify(&emoji::mindustry::to_discord(c)),