mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54: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:
|
try:
|
||||||
j = r.json()["eu"]["stats"].get("competitive")
|
j = r.json()["eu"]["stats"].get("competitive")
|
||||||
if j is None:
|
if j is None:
|
||||||
logging.debug(f"No stats for {repr(self)}, skipping...")
|
logger.debug(f"No stats for {repr(self)}, skipping...")
|
||||||
return
|
return
|
||||||
if not j["game_stats"]:
|
if not j["game_stats"]:
|
||||||
logging.debug(f"No stats for {repr(self)}, skipping...")
|
logger.debug(f"No stats for {repr(self)}, skipping...")
|
||||||
return
|
return
|
||||||
j = j["overall_stats"]
|
j = j["overall_stats"]
|
||||||
except TypeError:
|
except TypeError:
|
||||||
logging.debug(f"No stats for {repr(self)}, skipping...")
|
logger.debug(f"No stats for {repr(self)}, skipping...")
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
self.icon = re.search(r"https://.+\.cloudfront\.net/game/unlocks/(0x[0-9A-F]+)\.png", j["avatar"]).group(1)
|
self.icon = re.search(r"https://.+\.cloudfront\.net/game/unlocks/(0x[0-9A-F]+)\.png", j["avatar"]).group(1)
|
||||||
except AttributeError:
|
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.level = j["prestige"] * 100 + j["level"]
|
||||||
self.rank = j["comprank"]
|
self.rank = j["comprank"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue