(self, with_log: bool = False)
| 236 | self._log.info(f"<y>No daily reward available.</y>") |
| 237 | |
| 238 | async def update_points_balance(self, with_log: bool = False): |
| 239 | await asyncio.sleep(uniform(0.1, 0.5)) |
| 240 | balance = await self._api.my_points_balance() |
| 241 | if not balance: |
| 242 | return |
| 243 | points = balance.get("points", []) |
| 244 | for point in points: |
| 245 | balance = float(point.get("balance")) |
| 246 | if point.get("symbol") == "BP": |
| 247 | self._balance = balance |
| 248 | if point.get("symbol") == "PP": |
| 249 | self.play_passes = int(balance) |
| 250 | if not with_log: |
| 251 | return |
| 252 | self._log.info("Balance <g>{}</g>. Play passes: <g>{}</g>".format( |
| 253 | self._balance, self.play_passes |
| 254 | )) |
| 255 | |
| 256 | async def update_user_balance(self): |
| 257 | balance = await self._api.user_balance() |
no test coverage detected