mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
fixed the most annoying bug ever
This commit is contained in:
parent
3bbd2ed88f
commit
18843bb265
1 changed files with 4 additions and 4 deletions
8
db.py
8
db.py
|
@ -593,19 +593,19 @@ class Overwatch(Base):
|
|||
try:
|
||||
j = r.json()["eu"]["stats"].get("competitive")
|
||||
if j is None:
|
||||
logging.debug(f"No stats for {repr(self)}, skipping...")
|
||||
logger.debug(f"No stats for {repr(self)}, skipping...")
|
||||
return
|
||||
if not j["game_stats"]:
|
||||
logging.debug(f"No stats for {repr(self)}, skipping...")
|
||||
logger.debug(f"No stats for {repr(self)}, skipping...")
|
||||
return
|
||||
j = j["overall_stats"]
|
||||
except TypeError:
|
||||
logging.debug(f"No stats for {repr(self)}, skipping...")
|
||||
logger.debug(f"No stats for {repr(self)}, skipping...")
|
||||
return
|
||||
try:
|
||||
self.icon = re.search(r"https://.+\.cloudfront\.net/game/unlocks/(0x[0-9A-F]+)\.png", j["avatar"]).group(1)
|
||||
except AttributeError:
|
||||
logging.debug(f"No icon available for {repr(self)}.")
|
||||
logger.debug(f"No icon available for {repr(self)}.")
|
||||
self.level = j["prestige"] * 100 + j["level"]
|
||||
self.rank = j["comprank"]
|
||||
|
||||
|
|
Loading…
Reference in a new issue