# Path: steamapi/getproplayerlist.py
# def requestGetProPlayerList():
#     URL = "https://api.steampowered.com/IDOTA2Fantasy_570/GetProPlayerList/v1?key=" + SteamAPIKey
# 
# Path: steamapi/getheroes.py
# def requestGetHeroes():
#     URL = "https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key=" + SteamAPIKey + "&language=en_us"
# 
# Path: steamapi/getgameitems.py
# def requestGetGameItems():
#     URL = "https://api.steampowered.com/IEconDOTA2_570/GetGameItems/v1/?key=" + SteamAPIKey + "&language=en_us"
# 
# Path: converter/timeconverter.py
# def unixTimeConverter(timeVar):
# def durationTimeConverter(timeVar):
# 
# Path: converter/playerconverter.py
# def playerConverter(playerID, playerSummariesJson=None, includeMMR=False):
# def getMMR(playerID):
#     MMR = None
#         MMR = getMMR(playerID)
#         MMR = {}


from steamapi.getproplayerlist import proPlayerDictionary
from steamapi.getheroes import heroDictionary
from steamapi.getgameitems import itemDictionary
from converter import timeconverter, playerconverter
        loserkills = matchJson['result']["dire_score"]
    else:
        teamwinner = 'Dire'
        winnerkills = matchJson['result']["dire_score"]
        loserkills = matchJson['result']["radiant_score"]
    time = timeconverter.durationTimeConverter(matchJson['result']["duration"])

    #TODO: Provide additional information if match is tournament
    matchDate = timeconverter.unixTimeConverter(matchJson['result']["start_time"])
    firstBloodTime = timeconverter.durationTimeConverter(matchJson['result']["first_blood_time"])
    additionalInformation = 'Match ID: %s, match date: %s, first blood time: %s' %(matchID,matchDate,firstBloodTime)

    intro = introTemplate.format(matchid=matchID, teamwinner=teamwinner, winnerkills=winnerkills, loserkills=loserkills, time=time, additionalinformation=additionalInformation)

    radiantTable = ''
    direTable = ''
    teamStats = [{'level': 0, 'kills': 0, 'deaths': 0, 'assists': 0, 'lasthits': 0, 'denies': 0,
                  'xpm': 0, 'gpm': 0, 'hd': 0, 'hh': 0, 'td': 0
                  },
                {'level': 0, 'kills': 0, 'deaths': 0, 'assists': 0, 'lasthits': 0, 'denies': 0,
                 'xpm': 0, 'gpm': 0, 'hd': 0, 'hh': 0, 'td': 0
                }]
    for player in matchJson['result']['players']:
        #level, hero, player, kda, lh d, xpm, gpm, hd, hh, td

        stats = {'level': player['level'], 'kills': player['kills'], 'deaths': player['deaths'],
                 'assists': player['assists'], 'lasthits': player['last_hits'],
                 'denies': player['denies'], 'xpm': player["xp_per_min"], 'gpm': player["gold_per_min"],
                 'hd': player["hero_damage"], 'hh': player["hero_healing"], 'td': player["tower_damage"]}


# Path: steamapi/getproplayerlist.py
# def requestGetProPlayerList():
#     URL = "https://api.steampowered.com/IDOTA2Fantasy_570/GetProPlayerList/v1?key=" + SteamAPIKey
# 
# Path: steamapi/getheroes.py
# def requestGetHeroes():
#     URL = "https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key=" + SteamAPIKey + "&language=en_us"
# 
# Path: steamapi/getgameitems.py
# def requestGetGameItems():
#     URL = "https://api.steampowered.com/IEconDOTA2_570/GetGameItems/v1/?key=" + SteamAPIKey + "&language=en_us"
# 
# Path: converter/timeconverter.py
# def unixTimeConverter(timeVar):
# def durationTimeConverter(timeVar):
# 
# Path: converter/playerconverter.py
# def playerConverter(playerID, playerSummariesJson=None, includeMMR=False):
# def getMMR(playerID):
#     MMR = None
#         MMR = getMMR(playerID)
#         MMR = {}


# Path: displayreddit/drmatch.py
from steamapi.getproplayerlist import proPlayerDictionary
from steamapi.getheroes import heroDictionary
from steamapi.getgameitems import itemDictionary
from converter import timeconverter, playerconverter

        loserkills = matchJson['result']["dire_score"]
    else:
        teamwinner = 'Dire'
        winnerkills = matchJson['result']["dire_score"]
        loserkills = matchJson['result']["radiant_score"]
    time = timeconverter.durationTimeConverter(matchJson['result']["duration"])

    #TODO: Provide additional information if match is tournament
    matchDate = timeconverter.unixTimeConverter(matchJson['result']["start_time"])
    firstBloodTime = timeconverter.durationTimeConverter(matchJson['result']["first_blood_time"])
    additionalInformation = 'Match ID: %s, match date: %s, first blood time: %s' %(matchID,matchDate,firstBloodTime)

    intro = introTemplate.format(matchid=matchID, teamwinner=teamwinner, winnerkills=winnerkills, loserkills=loserkills, time=time, additionalinformation=additionalInformation)

    radiantTable = ''
    direTable = ''
    teamStats = [{'level': 0, 'kills': 0, 'deaths': 0, 'assists': 0, 'lasthits': 0, 'denies': 0,
                  'xpm': 0, 'gpm': 0, 'hd': 0, 'hh': 0, 'td': 0
                  },
                {'level': 0, 'kills': 0, 'deaths': 0, 'assists': 0, 'lasthits': 0, 'denies': 0,
                 'xpm': 0, 'gpm': 0, 'hd': 0, 'hh': 0, 'td': 0
                }]
    for player in matchJson['result']['players']:
        #level, hero, player, kda, lh d, xpm, gpm, hd, hh, td

        stats = {'level': player['level'], 'kills': player['kills'], 'deaths': player['deaths'],
                 'assists': player['assists'], 'lasthits': player['last_hits'],
                 'denies': player['denies'], 'xpm': player["xp_per_min"], 'gpm': player["gold_per_min"],
                 'hd': player["hero_damage"], 'hh': player["hero_healing"], 'td': player["tower_damage"]}


        hero = '[](/hero-%s)' %heroDictionary[player['hero_id']]