mirror of
https://github.com/sys-32Dev/hoyolab-auto-daily.git
synced 2026-08-08 20:06:33 +00:00
send discord webhook at the end
This commit is contained in:
9
index.js
9
index.js
@@ -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.')
|
||||
|
||||
Reference in New Issue
Block a user