From bca018520a36557c109b27ce2c0e5af1c9942297 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 7 Nov 2018 19:37:47 +0100 Subject: [PATCH] Don't crash if ship is sent without args --- telegrambot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegrambot.py b/telegrambot.py index 262fefc9..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