main
Your Name 1 year ago
parent 35c7844814
commit 12ce4a354c

@ -9,6 +9,14 @@ API_TOKEN = var.API_MAIN
bot = telebot.TeleBot(API_TOKEN) bot = telebot.TeleBot(API_TOKEN)
#Get home dir
#from subprocess import getoutput
#global home
#home = getoutput("echo $HOME")
#Work with OS
from os import system as sys
#Work with JSON #Work with JSON
import json import json
def read(): def read():
@ -19,6 +27,25 @@ def write():
with open("db.json", "w") as outfile: with open("db.json", "w") as outfile:
outfile.write(js) outfile.write(js)
def readfp():
with open('fp.json', 'r') as openfile:
var.fp = json.load(openfile)
def writefp():
js = json.dumps(var.fp, indent=4)
with open("fp.json", "w") as outfile:
outfile.write(js)
def readtime():
global home
with open(f'../db.json', 'r') as openfile:
var.dbtime = json.load(openfile)
def writetime():
js = json.dumps(var.dbtime, indent=4)
with open(f"../db.json", "w") as outfile:
outfile.write(js)
# sys(f'cp time_db.json {home}/db.json')
#SHA256 for sign #SHA256 for sign
import hashlib import hashlib
#Date&Time #Date&Time

Loading…
Cancel
Save