1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

should work!

This commit is contained in:
Steffo 2016-11-02 14:49:46 +01:00
parent cf584f29d2
commit 20180aaf83
3 changed files with 12 additions and 7 deletions

View file

@ -61,6 +61,8 @@ async def overwatch_status_change(timeout):
if r["data"]["competitive"]["rank"] is not None:
if "rank" not in db[player]["overwatch"] \
or int(r["data"]["competitive"]["rank"]) != db[player]["overwatch"]["rank"]:
if "rank" not in db[player]["overwatch"]:
db[player]["overwatch"]["rank"] = 0
# Send the message
loop.create_task(send_event(eventmsg=s.overwatch_rank_change,
player=player,

View file

@ -35,15 +35,17 @@ async def get_player_data(platform: str, region: str, battletag: str, **kwargs):
# Convert rank to a medal
def rank_to_medal(rank):
if int(rank) < 1500:
if int(rank) == 0:
return s.overwatch_medal_list[0]
elif int(rank) < 2000:
if int(rank) < 1500:
return s.overwatch_medal_list[1]
elif int(rank) < 2500:
elif int(rank) < 2000:
return s.overwatch_medal_list[2]
elif int(rank) < 3000:
elif int(rank) < 2500:
return s.overwatch_medal_list[3]
elif int(rank) < 3500:
elif int(rank) < 3000:
return s.overwatch_medal_list[4]
elif int(rank) < 4000:
elif int(rank) < 3500:
return s.overwatch_medal_list[5]
elif int(rank) < 4000:
return s.overwatch_medal_list[6]

View file

@ -7,7 +7,8 @@ overwatch_level_up = "{player} è salito al livello **{level}** su _Overwatch_!"
overwatch_rank_change = "{player} è passato da {oldmedal} {oldrank} a **{medal} {division}** su _Overwatch_!"
# Overwatch: Medal list
overwatch_medal_list = ["Bronzo",
overwatch_medal_list = ["Nulla",
"Bronzo",
"Argento",
"Oro",
"Platino",