diff --git a/CHANGELOG.md b/CHANGELOG.md index 9224ed1..9e61558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 更新记录 +### version: 2.3: + +宏查询接口调整,恢复使用 + ### version: 2.2: 接口地址调整,增加部分功能 diff --git a/core/jx3_data.py b/core/jx3_data.py index 0918392..d2b0cdb 100644 --- a/core/jx3_data.py +++ b/core/jx3_data.py @@ -1600,11 +1600,11 @@ class JX3Service: logger.debug(f"查询到数据:{kungfu}") # 1. 构造请求参数 - params = {"kungfu": kungfu} + params = {"subtype": kungfu} # 2. 调用基础请求 - data: Optional[list[Dict[str, Any]]] = await self._base_request( - "jx3box_hong", "GET", params=params, out_key="" + data: Optional[Dict[str, Any]] = await self._base_request( + "jx3box_hong", "GET", params=params ) logger.debug(data) if not data: @@ -1616,9 +1616,9 @@ class JX3Service: msg = "按照热度排列\n" n = 1 try: - for m in data: - msg += f"{n}、{m['author']}\t{m['item_version']}\n" - pid_list.append(m["pid"]) + for m in data.get('list',[]): + msg += f"{n}、{m['author']}\t{m['post_title']}\n" + pid_list.append(m["ID"]) n += 1 return_data["msg"] = msg diff --git a/data/api_config.json b/data/api_config.json index 0c4c0d8..1eb8ebc 100644 --- a/data/api_config.json +++ b/data/api_config.json @@ -357,12 +357,15 @@ } }, "jx3box_hong":{ - "url":"https://next2.jx3box.com/api/macro/tops", + "url":"https://cms.jx3box.com/api/cms/posts", "method":"GET", "description":"魔盒获取宏推荐列表", "params":{ - "kungfu": "易筋经", - "size": "20", + "subtype": "易筋经", + "type": "macro", + "per": "10", + "order": "update", + "sticky": "1", "client": "std" } }, diff --git a/main.py b/main.py index ffaf178..518cf01 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,7 @@ from .core.fun_basic import load_as_base64 @register("astrbot_plugin_jx3", "fxdyz", "通过调用剑网三API接口获取游戏数据,处理发送。", - "2.2", + "2.3", "https://github.com/qsc20001102/astrbot_plugin_jx3api" ) class Jx3ApiPlugin(Star):