koishi-plugin-group-analysis-mx 1.5.8 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/service/analysis.js
CHANGED
|
@@ -894,7 +894,8 @@ class AnalysisService extends koishi_1.Service {
|
|
|
894
894
|
if (normRaw)
|
|
895
895
|
nicknameAvatarMap.set(normRaw, user.avatar);
|
|
896
896
|
}
|
|
897
|
-
//
|
|
897
|
+
// 保留个人昵称(供话题 chip 匹配),排行榜显示名仍使用群名片
|
|
898
|
+
user.rawName = rawName;
|
|
898
899
|
user.nickname = displayName;
|
|
899
900
|
}
|
|
900
901
|
// 话题:参与者/描述里的用户 ID(官方 bot 为 openid)回填为昵称,回填不到显示"群友"
|
|
@@ -911,6 +912,12 @@ class AnalysisService extends koishi_1.Service {
|
|
|
911
912
|
}
|
|
912
913
|
const resolveTopicName = (raw) => {
|
|
913
914
|
const sVal = String(raw || '').trim();
|
|
915
|
+
// 形如 "昵称(openid)":只取昵称部分
|
|
916
|
+
const m = sVal.match(/^(.+?)\s*[((]([0-9A-Fa-f]{16,})[))]\s*$/);
|
|
917
|
+
if (m) {
|
|
918
|
+
const nick = m[1].trim();
|
|
919
|
+
return nick || topicIdToName.get(m[2]) || '群友';
|
|
920
|
+
}
|
|
914
921
|
const cleaned = sVal.replace(/[\[\]()()]/g, '').trim();
|
|
915
922
|
if (topicIdToName.has(cleaned))
|
|
916
923
|
return topicIdToName.get(cleaned);
|
package/lib/service/renderer.js
CHANGED
|
@@ -229,8 +229,12 @@ class RendererService extends koishi_1.Service {
|
|
|
229
229
|
// 话题昵称装饰:只给描述正文里的昵称加"头像 + 胶囊"小标签(参与者那一行不加)
|
|
230
230
|
const nameAvatar = new Map();
|
|
231
231
|
for (const u of (data.userStats || [])) {
|
|
232
|
-
if (u && u.
|
|
233
|
-
|
|
232
|
+
if (u && u.avatar && String(u.avatar).startsWith('data:')) {
|
|
233
|
+
for (const nm of [u.rawName, u.nickname]) {
|
|
234
|
+
if (nm && String(nm).trim())
|
|
235
|
+
nameAvatar.set(String(nm).trim(), u.avatar);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
234
238
|
}
|
|
235
239
|
// 昵称按长度降序,避免短名先替换把长名拆开
|
|
236
240
|
const chipNames = [...nameAvatar.keys()].filter((n) => n && n.trim()).sort((x, y) => y.length - x.length);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-group-analysis-mx",
|
|
3
3
|
"description": "群聊分析插件 - 生成精美群聊统计报告,支持 AI 话题总结(独立版,不依赖 ChatLuna)",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.mjs",
|
|
7
7
|
"typings": "lib/index.d.ts",
|
|
@@ -51,3 +51,5 @@
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
|
|
55
|
+
|