From c64592d54c8490906ad6eb184b7842f4519fa66b Mon Sep 17 00:00:00 2001 From: stapxs <1007028430.stapx@gmail.com> Date: Wed, 21 Aug 2024 13:41:45 +0800 Subject: [PATCH] =?UTF-8?q?Napcat=202.0=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :sparkles: napcat 2.0 支持,支持多分离式分组获取方式;支持分组排序信息 :bug: 修正 jsonpath 解析器无法拉取列表的问题 :lipstick: 脚本列表样式修改 :poop: 去除了独立回复消息字段支持的旧代码 :page_facing_up: direnv、asdf 配置文件补充,移除 nvm 配置文件 --- .envrc | 1 + .nvmrc | 1 - .tool-versions | 1 + src/assets/css/append/append_new.css | 8 +-- src/assets/pathMap/NapCat.Onebot.yaml | 15 ++++- src/background.ts | 4 +- src/components/MsgBody.vue | 35 +---------- src/function/electron/ipc.ts | 2 +- src/function/msg.ts | 63 +++++++++++++++++--- src/function/utils/msgUtil.ts | 2 +- src/pages/Scripts.vue | 84 ++++++++++++++++++--------- src/pages/chat-view/SystemNotice.vue | 4 +- src/pages/options/OptDev.vue | 2 +- 13 files changed, 139 insertions(+), 83 deletions(-) create mode 100644 .envrc delete mode 100644 .nvmrc create mode 100644 .tool-versions diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..b7e8bccc --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +export PYTHON_PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin/python diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 25bf17fc..00000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -18 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 00000000..343dc534 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 18.18.2 diff --git a/src/assets/css/append/append_new.css b/src/assets/css/append/append_new.css index 1dec176b..9c02066b 100644 --- a/src/assets/css/append/append_new.css +++ b/src/assets/css/append/append_new.css @@ -652,20 +652,20 @@ } .script-view .list > header > span { margin: 10px -5px 0 -5px; - font-size: 0.8rem; + font-size: 0.75rem; } .script-view .list-body { margin: 0 -5px; } .script-view .list-body h2 { - font-size: 0.9rem; + font-size: 0.8rem; } .script-view .list-body span { - font-size: 0.8rem; + font-size: 0.75rem; } .script-view .list-body span svg { margin: 0; - font-size: 0.75rem; + font-size: 0.7rem; } .script-view .editor-main { box-shadow: -5px 0px 4px -5px var(--color-shader); diff --git a/src/assets/pathMap/NapCat.Onebot.yaml b/src/assets/pathMap/NapCat.Onebot.yaml index 60609643..6c684595 100644 --- a/src/assets/pathMap/NapCat.Onebot.yaml +++ b/src/assets/pathMap/NapCat.Onebot.yaml @@ -15,10 +15,10 @@ login_info: # 群、好友列表 friend_list: name: get_friends_with_category - source: $.data[*] + source: $.data[*].buddyList[*] list: - class_id: /categoryId - class_name: /categroyName + class_id: null + class_name: null user_id: /user_id nickname: /nickname remark: /remark @@ -31,6 +31,15 @@ group_list: group_name: /group_name member_count: /member_count admin_flag: null +# 好友分组 +friend_category: + name: get_friends_with_category + source: $.data[*] + list: + class_id: /categoryId + class_name: /categoryName + sort_id: /categorySortId + users: $.buddyList[*].user_id # 消息列表 message_list: name: get_group_msg_history diff --git a/src/background.ts b/src/background.ts index 7bad8e86..ef593def 100644 --- a/src/background.ts +++ b/src/background.ts @@ -175,8 +175,8 @@ app.on('ready', async () => { if (isDevelopment && !process.env.IS_TEST) { try { await installExtension('nhdogjmejiglipccpnnnanhbledajbpd') - } catch (e: any) { - console.error('Vue Devtools failed to install:', e.toString()) + } catch (e: unknown) { + console.error('Vue Devtools failed to install:', (e as Error).toString()) } } createWindow() diff --git a/src/components/MsgBody.vue b/src/components/MsgBody.vue index a72d34d7..7dd26830 100644 --- a/src/components/MsgBody.vue +++ b/src/components/MsgBody.vue @@ -23,12 +23,6 @@ {{ isMe ? runtimeData.loginInfo.nickname : runtimeData.chatInfo.show.name }}
- -
- - {{ getRepInfo((data.source ? data.source.message : ''), data) }} -