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:
parent
0f3aa98d35
commit
4f7029baae
2 changed files with 6 additions and 9 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue