do not attempt to exec fetch if no url exists (fixes #83)
This commit is contained in:
parent
85dd5d76b8
commit
ec338e6893
|
@ -74,7 +74,9 @@ class Recaptcha_ {
|
|||
}
|
||||
|
||||
async notifyStaff(user: User, score: number) {
|
||||
return await fetch(process.env.DISCORD_WEBHOOK!, {
|
||||
if (!process.env.DISCORD_WEBHOOK) return;
|
||||
|
||||
return await fetch(process.env.DISCORD_WEBHOOK, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -86,7 +88,9 @@ class Recaptcha_ {
|
|||
}
|
||||
|
||||
async notifyStaffOfError(obj: any) {
|
||||
return await fetch(process.env.DISCORD_WEBHOOK!, {
|
||||
if (!process.env.DISCORD_WEBHOOK) return;
|
||||
|
||||
return await fetch(process.env.DISCORD_WEBHOOK, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
Loading…
Reference in New Issue