From 35574fa76ab9b9aa83c6c289ad906b178a405577 Mon Sep 17 00:00:00 2001 From: core Date: Fri, 21 Jul 2023 23:11:58 -0400 Subject: [PATCH] fix the websocket worker --- websocket-worker/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/websocket-worker/src/main.rs b/websocket-worker/src/main.rs index 74d4798..16b97f8 100644 --- a/websocket-worker/src/main.rs +++ b/websocket-worker/src/main.rs @@ -116,11 +116,12 @@ async fn main() -> Result<(), Box> { async fn send_webhook(msg: GatewayChatMessage, webhook: String) { let http = Http::new(""); let wh = Webhook::from_url(&http, &webhook).await.unwrap(); + wh.execute(&http, false, |w| { w.content(msg.message) .username(&msg.username) .allowed_mentions(|am| am.parse(ParseValue::Users).parse(ParseValue::Roles)) - .avatar_url(&format!("https://mc-heads.net/head/{}", msg.username)) + .avatar_url(&format!("https://mc-heads.net/head/{}", msg.username.split(' ').next().unwrap())) }).await.unwrap(); debug!("send job complete"); } \ No newline at end of file