From 7fe26e324c565e13eafa6fcc5bfd8bd82e86c04b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 7 Nov 2018 19:41:49 +0100 Subject: [PATCH] Announce league rank changes --- statsupdate.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/statsupdate.py b/statsupdate.py index b8bd621f..cd0956a9 100644 --- a/statsupdate.py +++ b/statsupdate.py @@ -37,7 +37,7 @@ def update_block(session: db.Session, block: list, delay: float=0, change_callba try: change = item.update(session=session) 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({ "item": repr(item) }) @@ -61,7 +61,11 @@ def new_dota_rank(item: db.Dota): def new_lol_rank(item: db.LeagueOfLegends): try: 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: logger.warning(f"Couldn't notify on Telegram: {item}")