mirror of
https://github.com/RYGhub/royalnet.git
synced 2025-02-17 10:53:57 +00:00
ora decente
This commit is contained in:
parent
0e6faf7adb
commit
1c49a3860b
1 changed files with 5 additions and 2 deletions
7
bot.py
7
bot.py
|
@ -677,7 +677,7 @@ while True:
|
|||
print("@" + username + ": /diario ")
|
||||
cmd = text.split(" ", 1)
|
||||
d = filemanager.readfile("diario.txt")
|
||||
d += "`" + str(int(time.time())) + "` | " + cmd[1] + "\n"
|
||||
d += str(int(time.time())) + "|" + cmd[1] + "\n"
|
||||
filemanager.writefile("diario.txt", d)
|
||||
telegram.sendmessage("Aggiunto al diario RYG.", sentin, source)
|
||||
elif text.startswith('/leggi'):
|
||||
|
@ -688,7 +688,10 @@ while True:
|
|||
text = str()
|
||||
# L'ultimo numero è escluso.
|
||||
for n in range(int(cmd[1]) + 1, 1, -1):
|
||||
text += d[len(d) - n] + "\n"
|
||||
riga = d[len(d) - n]
|
||||
riga = riga.split("|", 1)
|
||||
ora = time.gmtime(int(riga[0]))
|
||||
text += "`" + str(ora.tm_hour) + ":" + str(ora.tm_min) + "` " + riga[1] + "\n"
|
||||
telegram.sendmessage(text, sentin, source)
|
||||
else:
|
||||
print("@" + username + " bloccato.")
|
||||
|
|
Loading…
Add table
Reference in a new issue