feat: add discord logging
This commit is contained in:
parent
9238ce561b
commit
f01ef02324
|
@ -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()}`
|
||||||
|
)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue