feat: add free rewards redemption feature; require phone number in account config

This commit is contained in:
2025-11-15 17:07:19 +01:00
parent a4a248b236
commit 697e81ee2a
10 changed files with 583 additions and 23 deletions

View File

@@ -134,6 +134,17 @@ export class DesktopFlow {
}
}
// Do free rewards redemption
if (this.bot.config.workers.doFreeRewards) {
try {
await this.bot.workers.doFreeRewards(workerPage)
} catch (rewardsError) {
const errorMsg = rewardsError instanceof Error ? rewardsError.message : String(rewardsError)
this.bot.log(false, 'DESKTOP-FLOW', `Free rewards redemption failed: ${errorMsg}`, 'error')
// Don't throw - continue flow
}
}
// Fetch points BEFORE closing (avoid page closed reload error)
const after = await this.bot.browser.func.getCurrentPoints().catch(() => initial)