fix websocket worker so it stops sending thigns in discord from discord

This commit is contained in:
core 2023-07-20 19:13:59 -04:00
parent 6fd6945a5f
commit 304d37ded7
Signed by: core
GPG Key ID: FDBF740DADDCEECF
1 changed files with 2 additions and 0 deletions

View File

@ -9,6 +9,7 @@ use url::Url;
use websocket::{ClientBuilder, Message, OwnedMessage, WebSocketError}; use websocket::{ClientBuilder, Message, OwnedMessage, WebSocketError};
use websocket::websocket_base::result::WebSocketResult; use websocket::websocket_base::result::WebSocketResult;
use common::message::{GatewayChatMessage, GatewayPacketC2S, GatewayPacketS2C}; use common::message::{GatewayChatMessage, GatewayPacketC2S, GatewayPacketS2C};
use common::message::GatewayChatSource::Discord;
use common::status::{DATA_API_VERSION, Status}; use common::status::{DATA_API_VERSION, Status};
use crate::config::Config; use crate::config::Config;
@ -80,6 +81,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
} }
GatewayPacketS2C::Relayed { msg } => { GatewayPacketS2C::Relayed { msg } => {
info!("msg: {:?}", msg); info!("msg: {:?}", msg);
if matches!(msg.source, Discord) { continue; }
for wh in &config.websockets { for wh in &config.websockets {
tokio::spawn({ tokio::spawn({
let wh_clone = wh.clone(); let wh_clone = wh.clone();