fix the websocket worker

This commit is contained in:
core 2023-07-21 23:11:58 -04:00
parent e8a60c7f2d
commit 35574fa76a
Signed by: core
GPG Key ID: FDBF740DADDCEECF
1 changed files with 2 additions and 1 deletions

View File

@ -116,11 +116,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
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");
}