koishi-plugin-group-analysis-mx 1.2.2 → 1.2.3
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 +16 -8
- package/package.json +1 -1
package/lib/service/analysis.js
CHANGED
|
@@ -816,14 +816,6 @@ class AnalysisService extends koishi_1.Service {
|
|
|
816
816
|
}
|
|
817
817
|
avatarMap.set(String(user.userId), user.avatar || '');
|
|
818
818
|
}
|
|
819
|
-
// 用户称号列表同样补全头像(LLM 返回的 id 可能是数字类型)
|
|
820
|
-
if (Array.isArray(userTitles)) {
|
|
821
|
-
userTitles.forEach((title) => {
|
|
822
|
-
if (title && !title.avatar && avatarMap.has(String(title.id))) {
|
|
823
|
-
title.avatar = avatarMap.get(String(title.id));
|
|
824
|
-
}
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
819
|
// 昵称 → 原始昵称 / 头像 映射(金句、称号用),并对 emoji/空白做归一化以增强匹配。
|
|
828
820
|
// LLM 返回的 sender/name 常丢失 emoji,这里用真实昵称(含 emoji)替换显示。
|
|
829
821
|
const nicknameAvatarMap = new Map();
|
|
@@ -842,6 +834,22 @@ class AnalysisService extends koishi_1.Service {
|
|
|
842
834
|
}
|
|
843
835
|
}
|
|
844
836
|
}
|
|
837
|
+
// 用户称号:用真实昵称替换 LLM 生成的 name(保留 emoji),并补全头像
|
|
838
|
+
if (Array.isArray(userTitles)) {
|
|
839
|
+
userTitles.forEach((title) => {
|
|
840
|
+
if (title && title.name) {
|
|
841
|
+
const normalized = (0, utils_1.normalizeNickname)(title.name);
|
|
842
|
+
const realName = nicknameMap.get(title.name) ||
|
|
843
|
+
(normalized ? nicknameMap.get(normalized) : '') ||
|
|
844
|
+
'';
|
|
845
|
+
if (realName)
|
|
846
|
+
title.name = realName;
|
|
847
|
+
}
|
|
848
|
+
if (title && !title.avatar && avatarMap.has(String(title.id))) {
|
|
849
|
+
title.avatar = avatarMap.get(String(title.id));
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
}
|
|
845
853
|
// 金句:用真实昵称替换 LLM 生成的昵称(保留 emoji),并补全发送者头像
|
|
846
854
|
if (Array.isArray(goldenQuotes)) {
|
|
847
855
|
goldenQuotes.forEach((quote) => {
|
package/package.json
CHANGED