pimpbunny partial fixes

This commit is contained in:
Simon
2026-05-16 10:06:23 +00:00
committed by ForgeCode
parent 1aaa388f9e
commit dc70e2c9a6
3 changed files with 264 additions and 119 deletions

View File

@@ -52,11 +52,6 @@ pub async fn send_discord_error_report(
ERROR_CACHE.insert(error_signature, now);
// ---------------------------
let webhook_url = match std::env::var("DISCORD_WEBHOOK") {
Ok(url) => url,
Err(_) => return,
};
const MAX_FIELD: usize = 1024;
let truncate = |s: &str| {
if s.len() > MAX_FIELD {
@@ -103,6 +98,13 @@ pub async fn send_discord_error_report(
}]
});
let webhook_url = match std::env::var("DISCORD_WEBHOOK") {
Ok(url) => url,
Err(_) => {
// println!("{:#?}", &payload);
return;
}
};
let mut requester = requester::Requester::new();
let _ = requester.post_json(&webhook_url, &payload, vec![]).await;
}