From c48dd3fd879f51fa9e1f618ee84b81d5914b755d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 5 Mar 2017 23:14:47 +0100 Subject: [PATCH] Ignore ranks --- main.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/main.py b/main.py index 8fb6e03c..a97fbfae 100644 --- a/main.py +++ b/main.py @@ -71,20 +71,20 @@ async def overwatch_status_change(timeout): # Check for rank changes rank = r["data"]["competitive"]["rank"] if rank is not None: - rank = int(rank) - try: - oldrank = int(db[player]["overwatch"]["rank"]) - except KeyError: - oldrank = 0 - if rank != oldrank: - # Send the message - loop.create_task(send_event(eventmsg=s.overwatch_rank_change, - player=player, change=overwatch.format_rankchange(rank-oldrank), - rank=rank, medal=overwatch.url_to_medal(r["data"]["competitive"]["rank_img"]))) - # Update database - db[player]["overwatch"]["rank"] = rank - else: - db[player]["overwatch"]["rank"] = None + # rank = int(rank) + # try: + # oldrank = int(db[player]["overwatch"]["rank"]) + # except KeyError: + # oldrank = 0 + # if rank != oldrank: + # # Send the message + # loop.create_task(send_event(eventmsg=s.overwatch_rank_change, + # player=player, change=overwatch.format_rankchange(rank-oldrank), + # rank=rank, medal=overwatch.url_to_medal(r["data"]["competitive"]["rank_img"]))) + # # Update database + # db[player]["overwatch"]["rank"] = rank + # else: + db[player]["overwatch"]["rank"] = None save_db() finally: await asyncio.sleep(1)