node-karin 1.10.18 → 1.10.20
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/CHANGELOG.md +14 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +22 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.10.20](https://github.com/KarinJS/Karin/compare/core-v1.10.19...core-v1.10.20) (2025-07-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🐛 Bug Fixes
|
|
7
|
+
|
|
8
|
+
* 修复pr导致的编译错误 ([20daaf1](https://github.com/KarinJS/Karin/commit/20daaf1bd3713d3f4b7938f831897c7450c10bc8))
|
|
9
|
+
|
|
10
|
+
## [1.10.19](https://github.com/KarinJS/Karin/compare/core-v1.10.18...core-v1.10.19) (2025-07-14)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🐛 Bug Fixes
|
|
14
|
+
|
|
15
|
+
* 修复lagrange环境下 调用getHistoryMsg只使用getGroupMsgHistory的问题 ([#509](https://github.com/KarinJS/Karin/issues/509)) ([225cc58](https://github.com/KarinJS/Karin/commit/225cc58afd09bef0880a9874c220db5be5077369))
|
|
16
|
+
|
|
3
17
|
## [1.10.18](https://github.com/KarinJS/Karin/compare/core-v1.10.17...core-v1.10.18) (2025-07-07)
|
|
4
18
|
|
|
5
19
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -17979,20 +17979,33 @@ var init_core = __esm({
|
|
|
17979
17979
|
*/
|
|
17980
17980
|
async getHistoryMsg(contact3, startMsgId, count3) {
|
|
17981
17981
|
const result = await (async () => {
|
|
17982
|
+
const targetId = Number(contact3.peer);
|
|
17982
17983
|
if (typeof startMsgId === "number") {
|
|
17983
17984
|
if (this.adapter.name === "Lagrange.OneBot") {
|
|
17984
17985
|
throw new Error("Lagrange.OneBot\u4E0D\u652F\u6301\u901A\u8FC7seq\u83B7\u53D6\u5386\u53F2\u6D88\u606F");
|
|
17985
17986
|
}
|
|
17986
|
-
return this._onebot.getGroupMsgHistory(
|
|
17987
|
+
return this._onebot.getGroupMsgHistory(targetId, startMsgId, count3);
|
|
17987
17988
|
}
|
|
17988
17989
|
if (typeof startMsgId !== "string") {
|
|
17989
17990
|
throw new Error("startMsgId\u7C7B\u578B\u9519\u8BEF");
|
|
17990
17991
|
}
|
|
17991
17992
|
if (this.adapter.name === "Lagrange.OneBot") {
|
|
17992
|
-
|
|
17993
|
+
if (contact3.scene === "group") {
|
|
17994
|
+
return this._onebot.lgl_getGroupMsgHistory(targetId, Number(startMsgId), count3);
|
|
17995
|
+
} else if (contact3.scene === "friend") {
|
|
17996
|
+
return this._onebot.lgl_getFriendMsgHistory(targetId, Number(startMsgId), count3);
|
|
17997
|
+
} else {
|
|
17998
|
+
throw new Error(`\u4E0D\u652F\u6301\u7684\u6D88\u606F\u73AF\u5883:${contact3.scene}`);
|
|
17999
|
+
}
|
|
17993
18000
|
}
|
|
17994
18001
|
const seq2 = await this.getMsg(contact3, startMsgId);
|
|
17995
|
-
|
|
18002
|
+
if (contact3.scene === "group") {
|
|
18003
|
+
return this._onebot.getGroupMsgHistory(targetId, seq2.message_seq, count3);
|
|
18004
|
+
} else if (contact3.scene === "friend") {
|
|
18005
|
+
return this._onebot.nc_getFriendMsgHistory(targetId, seq2.message_seq, count3);
|
|
18006
|
+
} else {
|
|
18007
|
+
throw new Error(`\u4E0D\u652F\u6301\u7684\u6D88\u606F\u73AF\u5883:${contact3.scene}`);
|
|
18008
|
+
}
|
|
17996
18009
|
})();
|
|
17997
18010
|
return await Promise.all(result.messages.map(async (v) => {
|
|
17998
18011
|
const userId = v.sender.user_id + "" || "";
|
|
@@ -18009,12 +18022,17 @@ var init_core = __esm({
|
|
|
18009
18022
|
userId,
|
|
18010
18023
|
nick: v?.sender?.nickname || "",
|
|
18011
18024
|
name: v?.sender?.nickname || "",
|
|
18012
|
-
role: v?.sender?.role || "unknown",
|
|
18013
18025
|
sex: v?.sender?.sex || "unknown",
|
|
18014
18026
|
age: v?.sender?.age || 0,
|
|
18027
|
+
// @ts-ignore
|
|
18028
|
+
role: v?.sender?.role || "unknown",
|
|
18029
|
+
// @ts-ignore
|
|
18015
18030
|
card: v?.sender?.card || "",
|
|
18031
|
+
// @ts-ignore
|
|
18016
18032
|
area: v?.sender?.area || "",
|
|
18033
|
+
// @ts-ignore
|
|
18017
18034
|
level: Number(v?.sender?.level) || 0,
|
|
18035
|
+
// @ts-ignore
|
|
18018
18036
|
title: v?.sender?.title || ""
|
|
18019
18037
|
}),
|
|
18020
18038
|
elements: await this.AdapterConvertKarin(v.message)
|