1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +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, reply_msg(telegram_bot, main_chat_id, strings.STATSUPDATE.BRAWLHALLA.SOLO,
username=item.steam.royal.username, username=item.steam.royal.username,
rating=solo.value, rating=solo.value,
delta=solo.delta) delta=solo.delta_string())
if team.is_dirty(): if team.is_dirty():
partner = item.best_team_partner partner = item.best_team_partner
if partner is None: if partner is None:

View file

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