Skip to content

Commit

Permalink
send discord webhook at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
sglkc committed Oct 13, 2024
1 parent 69f0f19 commit c8271df
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.')
Expand Down

0 comments on commit c8271df

Please sign in to comment.