feat: add discord logging

This commit is contained in:
May 2024-11-21 20:32:07 -08:00
parent 9238ce561b
commit f01ef02324
Signed by: split
GPG key ID: C325C61F0BF517C0

View file

@ -20,7 +20,7 @@ export default translator({
// copied from a firefox private browsing window // copied from a firefox private browsing window
// realistically this will probably need updates in the future // realistically this will probably need updates in the future
// but for now this is good enough // but for now this is good enough
await fetch("https://discord.com/api/v9/users/@me", { let f = await fetch("https://discord.com/api/v9/users/@me", {
headers: { headers: {
"User-Agent": ua, "User-Agent": ua,
Accept: "*/*", Accept: "*/*",
@ -66,5 +66,10 @@ export default translator({
}), }),
method: "PATCH", method: "PATCH",
}) })
if (!f.ok)
throw new Error(
`discord: avatar set failed with ${f.status}: ${await f.text()}`
)
}, },
}) })