mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Ignore ranks
This commit is contained in:
parent
102b0656cc
commit
c48dd3fd87
1 changed files with 14 additions and 14 deletions
26
main.py
26
main.py
|
@ -71,19 +71,19 @@ 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:
|
||||
# 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:
|
||||
|
|
Loading…
Reference in a new issue