# Path: steamapi/getmatchdetails.py
# def getMatchDetails(matchID, q=None):
#             URL = "https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/V001/?key=" + SteamAPIKey + "&match_id=" + str(matchID)
# 
# Path: steamapi/getplayersummaries.py
# def getPlayerSummaries(accountIDs):
#             URL = "https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=" + SteamAPIKey + "&steamids=" + accountIDString
# 
# Path: displayreddit/drmatch.py
# def displayResult(matchJson, playerSummariesJson):
# 
# Path: odotaapi/requestparsematch.py
# def requestParseMatch(matchID, holdUntilParsed=False):
# def isParsed(jobId):


from steamapi import getmatchdetails, getplayersummaries
from displayreddit import drmatch
from odotaapi import requestparsematch
import threading

def match(matchID):


    t = threading.Thread(target=requestparsematch.requestParseMatch, args = (matchID,))
    t.start()

    matchJson = getmatchdetails.getMatchDetails(matchID)

    accountIDs = []
    for player in matchJson['result']['players']:
        accountIDs.append(player['account_id'])


# Path: steamapi/getmatchdetails.py
# def getMatchDetails(matchID, q=None):
#             URL = "https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/V001/?key=" + SteamAPIKey + "&match_id=" + str(matchID)
# 
# Path: steamapi/getplayersummaries.py
# def getPlayerSummaries(accountIDs):
#             URL = "https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=" + SteamAPIKey + "&steamids=" + accountIDString
# 
# Path: displayreddit/drmatch.py
# def displayResult(matchJson, playerSummariesJson):
# 
# Path: odotaapi/requestparsematch.py
# def requestParseMatch(matchID, holdUntilParsed=False):
# def isParsed(jobId):


# Path: botcommands/match.py
from steamapi import getmatchdetails, getplayersummaries
from displayreddit import drmatch
from odotaapi import requestparsematch
import threading


def match(matchID):


    t = threading.Thread(target=requestparsematch.requestParseMatch, args = (matchID,))
    t.start()

    matchJson = getmatchdetails.getMatchDetails(matchID)

    accountIDs = []
    for player in matchJson['result']['players']:
        accountIDs.append(player['account_id'])


    playerSummariesJson = getplayersummaries.getPlayerSummaries(accountIDs)