From b5eaf0283065673389ecf997541d217cf7fc7541 Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Sun, 6 Sep 2020 16:26:49 +0800 Subject: [Update] --- ATRI/modules/funcControl/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ATRI/modules/funcControl/__init__.py') 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' -- cgit v1.2.3