From 35bd5f561a203a513ad11f0e79a69265b666d971 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 15 Jan 2017 15:21:43 +0100 Subject: [PATCH] =?UTF-8?q?Stavolta=20=C3=A8=20la=20volta=20buona?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 0fabcfc3..300c7275 100644 --- a/bot.py +++ b/bot.py @@ -404,10 +404,11 @@ def diario(): # Aggiungi una riga al diario Royal Games print("@" + username + ": /diario ") if len(cmd) > 1: - if cmd[1].isprintable(): - cmd[1] = cmd[1].replace("\n", " ") + entry = text.split(" ", 1)[1] + if entry.isprintable(): + entry = entry.replace("\n", " ") fdiario = filemanager.readfile("diario.txt") - fdiario += str(int(time.time())) + "|" + cmd[1] + "\n" + fdiario += str(int(time.time())) + "|" + entry + "\n" filemanager.writefile("diario.txt", fdiario) telegram.sendmessage("Aggiunto al diario RYG.", sentin, source) else: