node-karin 1.10.18 → 1.10.21

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.10.21](https://github.com/KarinJS/Karin/compare/core-v1.10.20...core-v1.10.21) (2025-09-06)
4
+
5
+
6
+ ### 🐛 Bug Fixes
7
+
8
+ * close [#524](https://github.com/KarinJS/Karin/issues/524) ([b70cf3d](https://github.com/KarinJS/Karin/commit/b70cf3d57d8a20e1f6c85df45a482a768906f816))
9
+
10
+ ## [1.10.20](https://github.com/KarinJS/Karin/compare/core-v1.10.19...core-v1.10.20) (2025-07-16)
11
+
12
+
13
+ ### 🐛 Bug Fixes
14
+
15
+ * 修复pr导致的编译错误 ([20daaf1](https://github.com/KarinJS/Karin/commit/20daaf1bd3713d3f4b7938f831897c7450c10bc8))
16
+
17
+ ## [1.10.19](https://github.com/KarinJS/Karin/compare/core-v1.10.18...core-v1.10.19) (2025-07-14)
18
+
19
+
20
+ ### 🐛 Bug Fixes
21
+
22
+ * 修复lagrange环境下 调用getHistoryMsg只使用getGroupMsgHistory的问题 ([#509](https://github.com/KarinJS/Karin/issues/509)) ([225cc58](https://github.com/KarinJS/Karin/commit/225cc58afd09bef0880a9874c220db5be5077369))
23
+
3
24
  ## [1.10.18](https://github.com/KarinJS/Karin/compare/core-v1.10.17...core-v1.10.18) (2025-07-07)
4
25
 
5
26
 
package/README.md CHANGED
@@ -4,7 +4,11 @@
4
4
 
5
5
  `karin`(卡琳)是一款灵活、现代、极易扩展的 Node.js 插件化应用框架,专为开发者打造,助你轻松构建属于自己的高效工具链和自动化服务。
6
6
 
7
+ > 🎉 **重要更新**:感谢 [valqelyan](https://github.com/valqelyan) 的慷慨转让,从 2.0 版本开始,我们将正式使用 `karin` 作为 npm 包名!
8
+ > **Important Update**: Thanks to [valqelyan](https://github.com/valqelyan)'s generous transfer, starting from version 2.0, we will officially use `karin` as our npm package name!
9
+
7
10
  ✨ **主要特性**:
11
+
8
12
  - ~~插件化架构,支持热插拔,生态丰富~~
9
13
  - 一行命令即可初始化项目,快速上手
10
14
  - 丰富的 Web UI(基于 React + HeroUI),颜值与功能并存
@@ -20,7 +24,7 @@
20
24
 
21
25
  ## 快速开始
22
26
 
23
- [📚 查看最新文档](https://karin.fun/)
27
+ [📚 查看最新文档](https://karinjs.com/)
24
28
 
25
29
  一键初始化:`pnpm create karin`
26
30
 
@@ -34,10 +38,10 @@
34
38
 
35
39
  我们提供多个文档站点供您访问,解决可能出现的访问困难:
36
40
 
37
- - **主文档站**: [https://karin.fun](https://karin.fun) (基于 GitHub Pages)
41
+ - **主文档站**: [https://karinjs.com](https://karinjs.com) (基于 GitHub Pages)
38
42
  - **镜像站点**:
39
43
  - 憨憨镜像: [https://karin.hanhanz.top](https://karin.hanhanz.top) (**推荐访问**)
40
- - Vercel 镜像: [https://docs.karin.fun](https://docs.karin.fun) (**推荐访问**)
44
+ - Vercel 镜像: [https://docs.karinjs.com](https://docs.karinjs.com) (**推荐访问**)
41
45
  - Deno 镜像: [https://karin.deno.dev](https://karin.deno.dev) (**推荐访问**)
42
46
 
43
47
  > 💡 主文档站托管在 GitHub 上,如访问不畅,推荐使用 Deno 镜像站
@@ -48,7 +52,15 @@
48
52
  - docs: [ikenxuan](https://github.com/ikenxuan)
49
53
  - name: [fuqiuluo](https://github.com/fuqiuluo)
50
54
 
51
- > 🧙‍♂️ 感谢三位大佬的魔法加持!
55
+ ### 特别感谢 / Special Thanks
56
+
57
+ 感谢 [valqelyan](https://github.com/valqelyan) 将 `karin` npm 包名转让给我们!这位伟大的开发者将他们闲置的包名无偿转让,让 Karin 项目能够在 2.0 版本正式启用 `karin` 这个更直观的包名。
58
+
59
+ Thanks to [valqelyan](https://github.com/valqelyan) for transferring the `karin` npm package name to us! This amazing developer generously transferred their unused package name, allowing the Karin project to officially use the more intuitive `karin` package name starting from version 2.0.
60
+
61
+ 相关讨论请见:[valqelyan/karin#6](https://github.com/valqelyan/karin/issues/6)
62
+
63
+ > 🧙‍♂️ 感谢四位大佬的魔法加持!
52
64
 
53
65
  ### 贡献者
54
66
 
@@ -56,7 +68,7 @@
56
68
 
57
69
  [![贡献者](https://contributors-img.web.app/image?repo=KarinJS/Karin)](https://github.com/KarinJS/Karin/graphs/contributors)
58
70
 
59
- ![Alt](https://repobeats.axiom.co/api/embed/aaaa2759c8885691443a4d80e5753f975d4f250e.svg "Repobeats analytics image")
71
+ ![Alt](https://repobeats.axiom.co/api/embed/aaaa2759c8885691443a4d80e5753f975d4f250e.svg 'Repobeats analytics image')
60
72
 
61
73
  ---
62
74
 
@@ -65,7 +77,7 @@
65
77
  ## 常见问题
66
78
 
67
79
  - 文档没看懂?[点我提问](https://github.com/KarinJS/Karin/issues) 或加群 967068507
68
- - 插件不会写?欢迎参考[插件开发文档](https://karin.fun/plugins/)
80
+ - 插件不会写?欢迎参考[插件开发文档](https://karinjs.com/guide/index/)
69
81
  - 遇到 bug?大胆提 Issue,我们超快响应!
70
82
 
71
83
  ## 如何参与贡献(PR)
package/dist/index.d.ts CHANGED
@@ -833,7 +833,7 @@ interface MessageResponse {
833
833
  messageSeq: number;
834
834
  /** 消息来源目标信息 */
835
835
  contact: Contact;
836
- /** 消息发送者 */
836
+ /** 消息发送者 请注意role仅在群聊场景下有效 */
837
837
  sender: GroupSender;
838
838
  /** 消息元素 */
839
839
  elements: Array<Elements>;
package/dist/index.mjs CHANGED
@@ -3309,7 +3309,7 @@ var init_dist2 = __esm({
3309
3309
  * @param data - 事件数据
3310
3310
  */
3311
3311
  isEcho(data) {
3312
- return "echo" in data && "status" in data && "data" in data;
3312
+ return "echo" in data && "status" in data;
3313
3313
  }
3314
3314
  /**
3315
3315
  * 将`base64://`转为`base64://...`
@@ -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(Number(contact3.peer), startMsgId, count3);
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
- return this._onebot.lgl_getGroupMsgHistory(Number(contact3.peer), Number(startMsgId), count3);
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
- return this._onebot.getGroupMsgHistory(Number(contact3.peer), seq2.message_seq, count3);
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)
@@ -1 +1 @@
1
- export { Application, CookieOptions, Errback, ErrorRequestHandler, Express, Handler, IRoute, IRouter, IRouterHandler, IRouterMatcher, Locals, MediaType, NextFunction, Request, RequestHandler, RequestParamHandler, Response, RouterOptions, Send, default } from 'express';
1
+ export { Application, CookieOptions, Errback, ErrorRequestHandler, Express, Handler, IRoute, IRouter, IRouterHandler, IRouterMatcher, Locals, MediaType, NextFunction, Request, RequestHandler, RequestParamHandler, Response, Route, Router, RouterOptions, Send, application, default, json, raw, request, response, text, urlencoded } from 'express';
@@ -1 +1 @@
1
- export { default } from 'express';
1
+ export { Route, Router, application, default, json, raw, request, response, text, urlencoded } from 'express';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "1.10.18",
3
+ "version": "1.10.21",
4
4
  "description": "Lightweight, efficient, concise, and stable robot framework.",
5
5
  "keywords": [
6
6
  "node",
@@ -178,7 +178,7 @@
178
178
  "@karinjs/onebot": "workspace:*",
179
179
  "@karinjs/plugin-webui-network-monitor": "^1.0.3",
180
180
  "@karinjs/plugins-list": "^1.7.0",
181
- "@types/express": "^5.0.1",
181
+ "@types/express": "^5.0.3",
182
182
  "@types/lodash": "^4.17.16",
183
183
  "cross-env": "^7.0.3",
184
184
  "dotenv": "npm:@karinjs/dotenv@^1.1.2",