From 78e95fcbe9e2726b1c46102a124c137ebd6fd18f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 3 Mar 2016 14:52:32 +0100 Subject: [PATCH] Visualizza elenco audio se specificato non esiste --- bot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index ba3f702f..350e85e6 100644 --- a/bot.py +++ b/bot.py @@ -242,8 +242,13 @@ while True: elif text.startswith('/audio'): print("@" + username + ": /audio") cmd = text.split(" ", 1) - sendme = audiolist[cmd[1]] - telegram.senddocument(sendme, sentin) + if cmd[1] in audiolist: + sendme = audiolist[cmd[1]] + else: + sendme = chr(9888) + " L'audio richiesto non esiste!\n*Audio disponibili*:\n" + for audio in audiolist: + sendme += audio + "\n" + telegram.sendmessage(sendme, sentin) elif text.startswith('/sbam'): print("@" + username + ": /sbam") # Manda l'audio contenente gli sbam di tutti i membri Royal Games.