mirror of
https://github.com/SkyfallWasTaken/arcade-monitor.git
synced 2024-11-22 08:53:40 +00:00
Push to Slack Webhook
This commit is contained in:
parent
eb251ae927
commit
4c09b8e3cd
3 changed files with 6 additions and 4 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -39,6 +39,7 @@ dependencies = [
|
||||||
"indoc",
|
"indoc",
|
||||||
"scraper",
|
"scraper",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde-wasm-bindgen 0.6.5",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"worker",
|
"worker",
|
||||||
"worker-macros",
|
"worker-macros",
|
||||||
|
|
|
@ -22,3 +22,4 @@ indoc = "2.0.5"
|
||||||
# We don't use getrandom, but we enable the "js" feature to enable
|
# We don't use getrandom, but we enable the "js" feature to enable
|
||||||
# WebAssembly support.
|
# WebAssembly support.
|
||||||
getrandom = { version = "0.2", features = ["js"] }
|
getrandom = { version = "0.2", features = ["js"] }
|
||||||
|
serde-wasm-bindgen = "0.6.5"
|
||||||
|
|
|
@ -64,11 +64,11 @@ async fn run_scrape(env: Env) -> Result<String> {
|
||||||
let request = Request::new_with_init(
|
let request = Request::new_with_init(
|
||||||
&webhook_url,
|
&webhook_url,
|
||||||
RequestInit::new()
|
RequestInit::new()
|
||||||
.with_body(json!({
|
.with_body(Some(serde_wasm_bindgen::to_value(
|
||||||
"text": message,
|
&json!({ "text": message }),
|
||||||
}))
|
)?))
|
||||||
.with_method(Method::Post),
|
.with_method(Method::Post),
|
||||||
);
|
)?;
|
||||||
|
|
||||||
Fetch::Request(request).send().await?;
|
Fetch::Request(request).send().await?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue