fix the websocket worker
This commit is contained in:
parent
e8a60c7f2d
commit
35574fa76a
|
@ -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");
|
||||
}
|
Loading…
Reference in New Issue