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

Announce league rank changes

This commit is contained in:
Steffo 2018-11-07 19:41:49 +01:00
parent bca018520a
commit 7fe26e324c

View file

@ -37,7 +37,7 @@ def update_block(session: db.Session, block: list, delay: float=0, change_callba
try: try:
change = item.update(session=session) change = item.update(session=session)
except Exception as e: except Exception as e:
logger.error(f"Error {sys.exc_info()} while updating {repr(item)}.") logger.warning(f"Error {sys.exc_info()} while updating {repr(item)}.")
sentry.extra_context({ sentry.extra_context({
"item": repr(item) "item": repr(item)
}) })
@ -61,7 +61,11 @@ def new_dota_rank(item: db.Dota):
def new_lol_rank(item: db.LeagueOfLegends): def new_lol_rank(item: db.LeagueOfLegends):
try: try:
telegram_bot.send_message(config["Telegram"]["main_group"], telegram_bot.send_message(config["Telegram"]["main_group"],
f"✳️ {item.royal.username} è salito di rank su League of Legends!") f"✳️ {item.royal.username} ha cambiato rank su League of Legends!\n"
f"\n"
f"Solo/Duo: {item.solo_division} {item.solo_rank}\n"
f"Flex: {item.flex_division} {item.flex_rank}\n"
f"3v3: {item.twtr_division} {item.twtr_rank}")
except Exception: except Exception:
logger.warning(f"Couldn't notify on Telegram: {item}") logger.warning(f"Couldn't notify on Telegram: {item}")