diff options
author | Kyomotoi <[email protected]> | 2020-09-06 16:26:49 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2020-09-06 16:26:49 +0800 |
commit | b5eaf0283065673389ecf997541d217cf7fc7541 (patch) | |
tree | 4f37746e2971f45f05612ccd0e0bac4432346f47 /ATRI/modules/funcControl/__init__.py | |
parent | a36b6ecc37491b5cbf8c8750d252fbd53dc301ca (diff) | |
download | ATRI-b5eaf0283065673389ecf997541d217cf7fc7541.tar.gz ATRI-b5eaf0283065673389ecf997541d217cf7fc7541.tar.bz2 ATRI-b5eaf0283065673389ecf997541d217cf7fc7541.zip |
[Update]
Diffstat (limited to 'ATRI/modules/funcControl/__init__.py')
-rw-r--r-- | ATRI/modules/funcControl/__init__.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ATRI/modules/funcControl/__init__.py b/ATRI/modules/funcControl/__init__.py index f8e9259..c111b61 100644 --- a/ATRI/modules/funcControl/__init__.py +++ b/ATRI/modules/funcControl/__init__.py @@ -3,13 +3,19 @@ from pathlib import Path from typing import Optional -def checkSwitch(funcName: str): - file = Path('.') / 'ATRI' / 'plugins' / 'switch' / 'switch.json' +def checkSwitch(funcName: str, g: int): + file = Path('.') / 'ATRI' / 'modules' / 'funcControl' / 'ALLswitch.json' with open(file, 'r') as f: data = json.load(f) - if data[funcName] == "on": return True + else: + file = Path('.') / 'ATRI' / 'data' / 'groupData' / f'{g}' / 'switch.json' + with open(file, 'r') as f: + data = json.load(f) + + if data[funcName] == "on": + return True def checkNoob(user: int, group: Optional[int] = None): fileU = Path('.') / 'ATRI' / 'plugins' / 'noobList' / 'noobList.json' |