1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

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

This commit is contained in:
Ubuntu 2018-11-07 20:18:09 +01:00
commit 658d92069a
3 changed files with 9 additions and 3 deletions

View file

@ -475,6 +475,7 @@ class RoyalDiscordBot(discord.Client):
message += f" | 📺 {member.activity.name}"
message += "\n"
message += "\n"
message = message.replace("<", "&lt;").replace(">", "&gt;")
connection.send(message)
logger.debug(f"Answered successfully cvlist request.")
elif msg.startswith("!"):

View file

@ -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}")

View file

@ -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 <nome> <nome>`", 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 <comando> <argomenti>`", parse_mode="Markdown")
return
discord_connection.send(f"!{data}")
result = discord_connection.recv()
if result == "error":