send discord webhook at the end

This commit is contained in:
Seya
2024-10-13 08:03:53 +07:00
parent 69f0f19cd8
commit c8271df932

View File

@@ -102,11 +102,6 @@ async function run(cookie, games) {
log('error', game, `Error undocumented, report to Issues page if this persists`)
}
// send to discord webhook if set and valid url
if (discordWebhook && URL.canParse(discordWebhook)) {
await discordWebhookSend()
}
}
// custom log function to store messages
@@ -185,6 +180,10 @@ for (const index in cookies) {
await run(cookies[index], games[index])
}
if (discordWebhook && URL.canParse(discordWebhook)) {
await discordWebhookSend()
}
if (hasErrors) {
console.log('')
throw new Error('Error(s) occured.')