diff --git a/discordbot.py b/discordbot.py index b4a0a9d9..260e78c1 100644 --- a/discordbot.py +++ b/discordbot.py @@ -475,6 +475,7 @@ class RoyalDiscordBot(discord.Client): message += f" | 📺 {member.activity.name}" message += "\n" message += "\n" + message = message.replace("<", "<").replace(">", ">") connection.send(message) logger.debug(f"Answered successfully cvlist request.") elif msg.startswith("!"): 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}") diff --git a/telegrambot.py b/telegrambot.py index 03db9f88..a492117d 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -332,7 +332,7 @@ def cmd_eat(bot: Bot, update: Update): def cmd_ship(bot: Bot, update: Update): try: _, name_one, name_two = update.message.text.split(" ", 2) - except IndexError: + except ValueError: bot.send_message(update.message.chat.id, "⚠️ Non hai specificato correttamente i due nomi!\n" "Sintassi corretta: `/ship `", parse_mode="Markdown") return @@ -376,6 +376,7 @@ def cmd_bridge(bot: Bot, update: Update): except IndexError: bot.send_message(update.message.chat.id, "⚠ Non hai specificato un comando!\n" "Sintassi corretta: `/bridge `", parse_mode="Markdown") + return discord_connection.send(f"!{data}") result = discord_connection.recv() if result == "error":