fix websocket worker so it stops sending thigns in discord from discord
This commit is contained in:
parent
6fd6945a5f
commit
304d37ded7
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue