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

Fix Brawlhalla rank messages

This commit is contained in:
Steffo 2019-03-05 10:03:43 +01:00
parent 0f3aa98d35
commit 4f7029baae
2 changed files with 6 additions and 9 deletions

View file

@ -135,7 +135,7 @@ def brawlhalla_rank_change(item, change: typing.Tuple[DirtyDelta, Dirty]):
reply_msg(telegram_bot, main_chat_id, strings.STATSUPDATE.BRAWLHALLA.SOLO,
username=item.steam.royal.username,
rating=solo.value,
delta=solo.delta)
delta=solo.delta_string())
if team.is_dirty():
partner = item.best_team_partner
if partner is None:

View file

@ -24,12 +24,9 @@ class DirtyDelta(Dirty):
value = 0
else:
value = self.value
return value - initial_value
return abs(value - initial_value)
@delta.setter
def delta(self, value):
if self.initial_value is None:
initial_value = 0
else:
initial_value = self.initial_value
self.value = initial_value + value
def delta_string(self):
if self.delta > 0:
return f"+{self.delta}"
return self.delta