From 6e7d702c00906158f06303fb8f1189fca7a1d5f2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 12 Aug 2016 17:03:54 +0200 Subject: [PATCH] Fixed db load function --- overwatch.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/overwatch.py b/overwatch.py index 815a6a88..ed75f38d 100644 --- a/overwatch.py +++ b/overwatch.py @@ -3,13 +3,15 @@ import requests import json # Get player database from the db.json file -db = json.load("db.json") +file = open("db.json") +db = json.load(file) +file.close() # List overwatch players players = list() for player in db: - if player["overwatch"] is not None: - players.append(player["overwatch"]) + if db[player]["overwatch"] is not None: + players.append(db[player]["overwatch"]) # Get player data async def get_player_data(platform: str, region: str, battletag: str):