onebots 0.4.4 → 0.4.6

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/onebot.js CHANGED
@@ -30,7 +30,7 @@ const app_1 = require("./server/app");
30
30
  const utils_1 = require("./utils");
31
31
  const path_1 = require("path");
32
32
  const icqq_1 = require("icqq");
33
- const message_1 = require("icqq/lib/message");
33
+ const icqq_2 = require("icqq");
34
34
  const V11_1 = require("./service/V11");
35
35
  const V12_1 = require("./service/V12");
36
36
  const process = __importStar(require("process"));
@@ -48,6 +48,7 @@ class OneBot extends events_1.EventEmitter {
48
48
  this.uin = uin;
49
49
  config = [].concat(config);
50
50
  let platform = this.app.config.platform;
51
+ let sign_api_addr = this.app.config.sign_api_addr;
51
52
  this.config = config.map(c => {
52
53
  if (c.platform)
53
54
  platform = c.platform;
@@ -64,7 +65,7 @@ class OneBot extends events_1.EventEmitter {
64
65
  throw new Error('不支持的oneBot版本:' + c.version);
65
66
  }
66
67
  });
67
- this.client = new icqq_1.Client({ platform, data_dir: (0, path_1.join)(app_1.App.configDir, 'data') });
68
+ this.client = new icqq_1.Client({ platform, sign_api_addr, data_dir: (0, path_1.join)(app_1.App.configDir, 'data') });
68
69
  this.instances = this.config.map(c => {
69
70
  switch (c.version) {
70
71
  case 'V11':
@@ -179,13 +180,13 @@ class OneBot extends events_1.EventEmitter {
179
180
  case 'group':
180
181
  data.message.unshift({
181
182
  type: 'reply',
182
- message_id: (0, message_1.genGroupMessageId)(data.group_id, data.source.user_id, data.source.seq, data.source.rand, data.source.time)
183
+ message_id: (0, icqq_2.genGroupMessageId)(data.group_id, data.source.user_id, data.source.seq, data.source.rand, data.source.time)
183
184
  });
184
185
  break;
185
186
  case 'private':
186
187
  data.message.unshift({
187
188
  type: 'reply',
188
- message_id: (0, message_1.genDmMessageId)(data.source.user_id, data.source.seq, data.source.rand, data.source.time)
189
+ message_id: (0, icqq_2.genDmMessageId)(data.source.user_id, data.source.seq, data.source.rand, data.source.time)
189
190
  });
190
191
  break;
191
192
  }
@@ -43,6 +43,7 @@ export declare namespace App {
43
43
  path?: string;
44
44
  timeout?: number;
45
45
  log_level?: LogLevel;
46
+ sign_api_addr?: string;
46
47
  platform?: Platform;
47
48
  general?: {
48
49
  V11?: V11.Config;
@@ -23,6 +23,7 @@ export declare class CommonAction {
23
23
  sender: {
24
24
  user_id: number;
25
25
  nickname: string;
26
+ sub_id: string;
26
27
  card: string;
27
28
  sex: import("icqq").Gender;
28
29
  age: number;
@@ -43,6 +44,7 @@ export declare class CommonAction {
43
44
  pktnum: number;
44
45
  index: number;
45
46
  div: number;
47
+ cqCode: string;
46
48
  } | {
47
49
  message: V12.SegmentElem<keyof V12.SegmentMap>[];
48
50
  message_type: "private";
@@ -68,6 +70,7 @@ export declare class CommonAction {
68
70
  pktnum: number;
69
71
  index: number;
70
72
  div: number;
73
+ cqCode: string;
71
74
  }>;
72
75
  getSelfInfo(this: V12): {
73
76
  user_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onebots",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "基于icqq的多例oneBot实现",
5
5
  "engines": {
6
6
  "node": ">=16"
@@ -55,8 +55,8 @@
55
55
  "dependencies": {
56
56
  "@koa/router": "^10.1.1",
57
57
  "@zhinjs/shared": "^0.0.9",
58
- "icqq": "^0.3.15",
59
- "icqq-cq-enable": "^1.0.0",
58
+ "icqq": "^0.4.1",
59
+ "icqq-cq-enable": "^1.0.1",
60
60
  "js-yaml": "^4.1.0",
61
61
  "koa": "^2.13.4",
62
62
  "koa-bodyparser": "^4.3.0",