MCPcopy Create free account
hub / github.com/HiddenCodeDevs/BlumTelegramBot / update_points_balance

Method update_points_balance

bot/core/tapper.py:238–254  ·  view source on GitHub ↗
(self, with_log: bool = False)

Source from the content-addressed store, hash-verified

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()

Callers 3

check_tasksMethod · 0.95
play_drop_gameMethod · 0.95
runMethod · 0.95

Calls 2

my_points_balanceMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected