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

Merge branch 'master' of github.com:Steffo99/royalnet

This commit is contained in:
Steffo 2019-03-11 10:50:23 +01:00
commit fc0e6e574c
3 changed files with 19 additions and 12 deletions

View file

@ -133,17 +133,17 @@ def brawlhalla_rank_change(item, change: typing.Tuple[DirtyDelta, Dirty]):
try: try:
if solo.delta >= 10: if solo.delta >= 10:
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.telegram.mention(),
rating=solo.value, rating=solo.value,
delta=solo.delta_string()) delta=solo.difference_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:
other = "???" other = "qualcun altro"
else: else:
other = partner.steam.royal.username other = partner.steam.royal.telegram.mention()
reply_msg(telegram_bot, main_chat_id, strings.STATSUPDATE.BRAWLHALLA.TEAM, reply_msg(telegram_bot, main_chat_id, strings.STATSUPDATE.BRAWLHALLA.TEAM,
username=item.steam.royal.username, username=item.steam.royal.telegram.mention(),
rating=team.value[1], rating=team.value[1],
other=other) other=other)
except Exception: except Exception:

View file

@ -14,8 +14,9 @@ class Dirty:
class DirtyDelta(Dirty): class DirtyDelta(Dirty):
@property @property
def delta(self): def difference(self):
if self.initial_value is None: if self.initial_value is None:
initial_value = 0 initial_value = 0
else: else:
@ -24,9 +25,13 @@ class DirtyDelta(Dirty):
value = 0 value = 0
else: else:
value = self.value value = self.value
return abs(value - initial_value) return value - initial_value
def delta_string(self): @property
if self.delta > 0: def delta(self):
return f"+{self.delta}" return abs(self.difference)
return self.delta
def difference_string(self):
if self.difference > 0:
return f"+{self.difference}"
return self.difference

View file

@ -26,8 +26,10 @@ emojis = {
"a": ["🅰️"], "a": ["🅰️"],
"b": ["🅱️"], "b": ["🅱️"],
"c": ["☪️", "©", "🥐"], "c": ["☪️", "©", "🥐"],
"d": ["🇩"],
"e": ["📧", "💶"], "e": ["📧", "💶"],
"f": ["🎏"], "f": ["🎏"],
"g": ["🇬"],
"h": ["🏨", "🏩", "🏋‍♀", "🏋‍♂"], "h": ["🏨", "🏩", "🏋‍♀", "🏋‍♂"],
"i": ["", "♊️", "🕕"], "i": ["", "♊️", "🕕"],
"j": ["⤴️"], "j": ["⤴️"],
@ -44,8 +46,8 @@ emojis = {
"u": ["", "⚓️", "🍉", "🌙", "🐋"], "u": ["", "⚓️", "🍉", "🌙", "🐋"],
"v": ["", "🔽", "☑️", "✔️"], "v": ["", "🔽", "☑️", "✔️"],
"w": ["🤷‍♀","🤷‍♂", "🤾‍♀", "🤾‍♂", "🤽‍♀", "🤽‍♂"], "w": ["🤷‍♀","🤷‍♂", "🤾‍♀", "🤾‍♂", "🤽‍♀", "🤽‍♂"],
"y": ["💴"],
"x": ["🙅‍♀", "🙅‍♂", "", ""], "x": ["🙅‍♀", "🙅‍♂", "", ""],
"y": ["💴"],
"z": ["⚡️"] "z": ["⚡️"]
} }