diff --git a/statsupdate.py b/statsupdate.py index 70a9d5f2..548976da 100644 --- a/statsupdate.py +++ b/statsupdate.py @@ -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: diff --git a/utils/dirty.py b/utils/dirty.py index 6b78604e..b709b6e0 100644 --- a/utils/dirty.py +++ b/utils/dirty.py @@ -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