join the score on a dash so it looks a bit nicer #18
This commit is contained in:
parent
fcbd4cd985
commit
edb117152e
@ -176,6 +176,7 @@ def get_match_stats(blob, target_player):
|
|||||||
match_data = requests.get("{}{}".format(base_url, match_endpoint)).json()
|
match_data = requests.get("{}{}".format(base_url, match_endpoint)).json()
|
||||||
fav_weapon = match_data['battleReportPersonalStatistics'][0]['bestWeapon']
|
fav_weapon = match_data['battleReportPersonalStatistics'][0]['bestWeapon']
|
||||||
accuracy = match_data['battleReportPersonalStatistics'][0]['bestWeaponAccuracyPercent']
|
accuracy = match_data['battleReportPersonalStatistics'][0]['bestWeaponAccuracyPercent']
|
||||||
|
score = '-'.join(str(x) for x in match_data['teamScores'])
|
||||||
|
|
||||||
for team_mate in match_data['battleReportPersonalStatistics']:
|
for team_mate in match_data['battleReportPersonalStatistics']:
|
||||||
if team_mate['nickname'].lower() == target_player.lower():
|
if team_mate['nickname'].lower() == target_player.lower():
|
||||||
@ -185,7 +186,7 @@ def get_match_stats(blob, target_player):
|
|||||||
kill_death_ratio = round(float(match_data['battleReportPersonalStatistics'][0]['kills']) / match_data['battleReportPersonalStatistics'][0]['deaths'], 2)
|
kill_death_ratio = round(float(match_data['battleReportPersonalStatistics'][0]['kills']) / match_data['battleReportPersonalStatistics'][0]['deaths'], 2)
|
||||||
|
|
||||||
return_blob = "Final score: {}\nK/D: {}\nFavorite Weapon: {} | {}% Accuracy\nXP Earned: {} | Favor Earned: {}".format(
|
return_blob = "Final score: {}\nK/D: {}\nFavorite Weapon: {} | {}% Accuracy\nXP Earned: {} | Favor Earned: {}".format(
|
||||||
match_data['teamScores'],
|
score,
|
||||||
kill_death_ratio,
|
kill_death_ratio,
|
||||||
prettify(fav_weapon),
|
prettify(fav_weapon),
|
||||||
accuracy,
|
accuracy,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user