1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2026-06-09 20:04:52 +00:00

feat(bounty): add error handler choice

This commit is contained in:
2023-11-20 17:28:55 +08:00
parent bbf3bf7c36
commit 2c19afdf26
8 changed files with 55 additions and 2 deletions
+9 -2
View File
@@ -33,9 +33,16 @@ class Bounty(BountyUI):
task = list(self.bounty_info)
if not task:
logger.warning('Bounty enabled but no task set')
self.error_handler()
return task
def error_handler(self):
action = self.config.Bounty_OnError
if action == 'stop':
raise RequestHumanTakeover
elif action == 'skip':
self.config.task_delay(server_update=True)
self.config.task_stop()
return task
@property
def is_ticket_enough(self) -> bool:
@@ -67,7 +74,7 @@ class Bounty(BountyUI):
case BountyStatus.SELECT:
if not self.is_ticket_enough:
logger.warning('Bounty ticket not enough')
raise RequestHumanTakeover
self.error_handler()
if self.select_bounty(*self.current_bounty):
return BountyStatus.ENTER
case BountyStatus.ENTER: