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

Don't crash if ship is sent without args

This commit is contained in:
Steffo 2018-11-07 19:37:47 +01:00
parent b92702548d
commit bca018520a

View file

@ -332,7 +332,7 @@ def cmd_eat(bot: Bot, update: Update):
def cmd_ship(bot: Bot, update: Update): def cmd_ship(bot: Bot, update: Update):
try: try:
_, name_one, name_two = update.message.text.split(" ", 2) _, 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" bot.send_message(update.message.chat.id, "⚠️ Non hai specificato correttamente i due nomi!\n"
"Sintassi corretta: `/ship <nome> <nome>`", parse_mode="Markdown") "Sintassi corretta: `/ship <nome> <nome>`", parse_mode="Markdown")
return return