diff options
author | Lint Action <[email protected]> | 2022-11-04 02:45:05 +0000 |
---|---|---|
committer | Lint Action <[email protected]> | 2022-11-04 02:45:05 +0000 |
commit | b127b3e7704750ee23a92613efcc4ee11c829c41 (patch) | |
tree | 5a12a58aedb033468c5100781f66a6e41f725a18 /ATRI/plugins | |
parent | 5a245fd7132b5d4da13ee83bd0eadb91d41735b6 (diff) | |
download | ATRI-b127b3e7704750ee23a92613efcc4ee11c829c41.tar.gz ATRI-b127b3e7704750ee23a92613efcc4ee11c829c41.tar.bz2 ATRI-b127b3e7704750ee23a92613efcc4ee11c829c41.zip |
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/plugins')
-rw-r--r-- | ATRI/plugins/console/driver/api.py | 4 | ||||
-rw-r--r-- | ATRI/plugins/essential/data_source.py | 6 | ||||
-rw-r--r-- | ATRI/plugins/essential/listener.py | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/ATRI/plugins/console/driver/api.py b/ATRI/plugins/console/driver/api.py index 4b78906..4319954 100644 --- a/ATRI/plugins/console/driver/api.py +++ b/ATRI/plugins/console/driver/api.py @@ -79,7 +79,9 @@ def block_list_info(_=Depends(http_author)): return {"status": status.HTTP_200_OK, "data": get_block_list()} -def edit_block_list(enabled: str, user_id: str = str(), group_id: str = str(), _=Depends(http_author)): +def edit_block_list( + enabled: str, user_id: str = str(), group_id: str = str(), _=Depends(http_author) +): return { "status": status.HTTP_200_OK, "data": _edit_block_list(bool(int(enabled)), user_id, group_id), diff --git a/ATRI/plugins/essential/data_source.py b/ATRI/plugins/essential/data_source.py index 8274db0..d158c70 100644 --- a/ATRI/plugins/essential/data_source.py +++ b/ATRI/plugins/essential/data_source.py @@ -7,7 +7,7 @@ from ATRI.message import MessageSegment def recall_msg_dealer(message: Union[dict, str]) -> str: if isinstance(message, str): return message - + cache_list = list() for i in message: _type = i.get("type") @@ -25,5 +25,5 @@ def recall_msg_dealer(message: Union[dict, str]) -> str: cache_list.append(MessageSegment.face(_data["id"])) else: cache_list.append(f"[未知类型信息: {_data}]") - - return str().join(map(str, cache_list))
\ No newline at end of file + + return str().join(map(str, cache_list)) diff --git a/ATRI/plugins/essential/listener.py b/ATRI/plugins/essential/listener.py index fd05cba..e342ada 100644 --- a/ATRI/plugins/essential/listener.py +++ b/ATRI/plugins/essential/listener.py @@ -17,13 +17,13 @@ async def _(event: MessageEvent): if not blockuser_file_path.is_file(): with open(blockuser_file_path, "w", encoding="utf-8") as w: w.write(json.dumps(dict())) - + data = json.loads(blockuser_file_path.read_bytes()) - + user_id = event.get_user_id() if user_id in data: raise IgnoredException(f"Blocked user: {user_id}") - + if isinstance(event, GroupMessageEvent): blockgroup_file_path = __MANEGE_DIR / "block_group.json" if not blockgroup_file_path.is_file(): @@ -31,7 +31,7 @@ async def _(event: MessageEvent): w.write(json.dumps(dict())) data = json.loads(blockgroup_file_path.read_bytes()) - + group_id = str(event.group_id) if group_id in data: raise IgnoredException(f"Blocked group: {group_id}") |