diff --git a/azalea-worker/src/main.rs b/azalea-worker/src/main.rs index fcd8e5d..5075835 100644 --- a/azalea-worker/src/main.rs +++ b/azalea-worker/src/main.rs @@ -278,12 +278,11 @@ async fn handle_packet(e: Event, config: &Config, client: &mut Client, ws_stream Event::Init => {} Event::Login => {} Event::Chat(pkt) => { - if pkt.content().starts_with("/skill") { - return Ok(()); + if !pkt.content().starts_with("/skill") { + info!("<{} ({})> {}", pkt.username().unwrap_or("SYSTEM".to_string()), pkt.uuid().map(|u| u.to_string()).unwrap_or("SYSTEM".to_string()), pkt.message()); + handle_message(pkt.clone(), client, config).await; } - info!("<{} ({})> {}", pkt.username().unwrap_or("SYSTEM".to_string()), pkt.uuid().map(|u| u.to_string()).unwrap_or("SYSTEM".to_string()), pkt.message()); - let re = Regex::new(r"@[a-z0-9_-]+:").unwrap(); if !(re.is_match(&pkt.content()) && pkt.uuid() == Some(config.server.uuid)) { info!("sending message"); @@ -295,7 +294,7 @@ async fn handle_packet(e: Event, config: &Config, client: &mut Client, ws_stream }})?)).await?; } - handle_message(pkt.clone(), client, config).await; + /* diff --git a/websocket-worker/src/main.rs b/websocket-worker/src/main.rs index 16b97f8..f457897 100644 --- a/websocket-worker/src/main.rs +++ b/websocket-worker/src/main.rs @@ -80,6 +80,7 @@ async fn main() -> Result<(), Box> { return Err("Disconnected by server")?; } GatewayPacketS2C::Relayed { msg } => { + if msg.message.contains("/skill") { continue; } // fix chatspam problem info!("msg: {:?}", msg); if matches!(msg.source, Discord) { continue; } for wh in &config.websockets {