1
Fork 0
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:
Steffo 2018-12-18 19:45:08 +01:00
parent 3bbd2ed88f
commit 18843bb265

8
db.py
View file

@ -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"]