diff options
Diffstat (limited to 'ATRI/modules/favoIMP/__init__.py')
-rw-r--r-- | ATRI/modules/favoIMP/__init__.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/ATRI/modules/favoIMP/__init__.py b/ATRI/modules/favoIMP/__init__.py deleted file mode 100644 index 3dabdae..0000000 --- a/ATRI/modules/favoIMP/__init__.py +++ /dev/null @@ -1,58 +0,0 @@ -import json -from random import randint -from pathlib import Path - -def GetFavoIMP(u): - try: - with open(Path('.') / 'ATRI' / 'modules' / 'favoIMP' / 'user.json', 'r') as f: - data = json.load(f) - except: - return 0 - - try: - if data[f"{u}"][0]: - pass - else: - return 0 - except: - return 0 - - return [data[f"{u}"][0], data[f"{u}"][1]] - -def AddFavoIMP(u, f:int, s:bool): - if s: - favoIMP = randint(1,f) - else: - favoIMP = f - try: - with open(Path('.') / 'ATRI' / 'modules' / 'favoIMP' / 'user.json', 'r') as a: - data = json.load(a) - data[f"{u}"][0] = int(data[f"{u}"][0]) + favoIMP - with open(Path('.') / 'ATRI' / 'modules' / 'favoIMP' / 'user.json', 'w') as a: - a.write(json.dumps(data)) - a.close() - except: - data = {} - data[f"{u}"] = [f"{favoIMP}"] - with open(Path('.') / 'ATRI' / 'modules' / 'favoIMP' / 'user.json', 'w') as a: - a.write(json.dumps(data)) - a.close() - -def DelFavoIMP(u, f:int, s:bool): - if s: - favoIMP = randint(1,f) - else: - favoIMP = f - try: - with open(Path('.') / 'ATRI' / 'modules' / 'favoIMP' / 'user.json', 'r') as a: - data = json.load(a) - data[f"{u}"][0] = int(data[f"{u}"][0]) - favoIMP - with open(Path('.') / 'ATRI' / 'modules' / 'favoIMP' / 'user.json', 'w') as a: - a.write(json.dumps(data)) - a.close() - except: - data = {} - data[f"{u}"] = [f"{0 - favoIMP}"] - with open(Path('.') / 'ATRI' / 'modules' / 'favoIMP' / 'user.json', 'w') as a: - a.write(json.dumps(data)) - a.close()
\ No newline at end of file |