1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Stavolta è la volta buona

This commit is contained in:
Steffo 2017-01-15 15:21:43 +01:00
parent 8d8d29e654
commit 35bd5f561a

7
bot.py
View file

@ -404,10 +404,11 @@ def diario():
# Aggiungi una riga al diario Royal Games # Aggiungi una riga al diario Royal Games
print("@" + username + ": /diario ") print("@" + username + ": /diario ")
if len(cmd) > 1: if len(cmd) > 1:
if cmd[1].isprintable(): entry = text.split(" ", 1)[1]
cmd[1] = cmd[1].replace("\n", " ") if entry.isprintable():
entry = entry.replace("\n", " ")
fdiario = filemanager.readfile("diario.txt") 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) filemanager.writefile("diario.txt", fdiario)
telegram.sendmessage("Aggiunto al diario RYG.", sentin, source) telegram.sendmessage("Aggiunto al diario RYG.", sentin, source)
else: else: