(self)
| 109 | return [] |
| 110 | |
| 111 | async def check_tasks(self) -> bool: |
| 112 | if settings.AUTO_TASKS is not True: |
| 113 | return False |
| 114 | |
| 115 | await asyncio.sleep(uniform(1, 3)) |
| 116 | blum_database = await get_blum_database() |
| 117 | tasks_codes = blum_database.get('tasks') |
| 118 | tasks = await self.get_tasks() |
| 119 | |
| 120 | is_task_started = False |
| 121 | |
| 122 | for task in tasks: |
| 123 | await asyncio.sleep(uniform(0.5, 1)) |
| 124 | |
| 125 | if not task.get('status'): |
| 126 | continue |
| 127 | if task.get('status') == "NOT_STARTED": |
| 128 | self._log.info(f"Started doing task - <cyan>'{task['title']}'</cyan>") |
| 129 | is_task_started = await self._api.start_task(task_id=task["id"]) |
| 130 | elif task['status'] == "READY_FOR_CLAIM": |
| 131 | status = await self._api.claim_task(task_id=task["id"]) |
| 132 | if status: |
| 133 | self._log.success(f"Claimed task - <cyan>'{task['title']}'</cyan>") |
| 134 | elif task['status'] == "READY_FOR_VERIFY" and task['validationType'] == 'KEYWORD': |
| 135 | await asyncio.sleep(uniform(1, 3)) |
| 136 | keyword = [item["answer"] for item in tasks_codes if item['id'] == task["id"]] |
| 137 | if not keyword: |
| 138 | continue |
| 139 | status = await self._api.validate_task(task["id"], keyword.pop()) |
| 140 | if not status: |
| 141 | continue |
| 142 | self._log.success(f"Validated task - <cyan>'{task['title']}'</cyan>") |
| 143 | status = await self._api.claim_task(task["id"]) |
| 144 | if status: |
| 145 | self._log.success(f"Claimed task - <cyan>'{task['title']}'</cyan>") |
| 146 | await asyncio.sleep(uniform(0.5, 1)) |
| 147 | await self.update_user_balance() |
| 148 | await self.update_points_balance() |
| 149 | return is_task_started |
| 150 | |
| 151 | async def play_drop_game(self): |
| 152 | if settings.PLAY_GAMES is not True or not self.play_passes: |
no test coverage detected