onebots 0.1.17 → 0.1.18

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
@@ -129,7 +129,7 @@ class OneBot extends events_1.EventEmitter {
129
129
  case 'private':
130
130
  data.message.shift({
131
131
  type: 'reply',
132
- message_id: (0, message_1.genDmMessageId)(data.source.user_id, data.source.seq, data.source.rand, data.source.rand, data.source.time)
132
+ message_id: (0, message_1.genDmMessageId)(data.source.user_id, data.source.seq, data.source.rand, data.source.time)
133
133
  });
134
134
  break;
135
135
  }
@@ -1,5 +1,4 @@
1
1
  import { V12 } from '../../../service/V12';
2
- import { OnlineStatus } from "icqq";
3
2
  import { Action } from "./";
4
3
  import { V11 } from "../../../service/V11";
5
4
  export declare class CommonAction {
@@ -24,7 +23,7 @@ export declare class CommonAction {
24
23
  good: boolean;
25
24
  bots: {
26
25
  self: any;
27
- online: OnlineStatus;
26
+ online: boolean;
28
27
  }[];
29
28
  };
30
29
  getLatestEvents(this: V12, limit?: number, timout?: number): Promise<V12.Payload<keyof Action>[]>;
@@ -35,7 +35,7 @@ class CommonAction {
35
35
  bots: [
36
36
  {
37
37
  self: this.action.getSelfInfo.apply(this),
38
- online: this.client.status = icqq_1.OnlineStatus.Online,
38
+ online: this.client.status === icqq_1.OnlineStatus.Online,
39
39
  }
40
40
  ]
41
41
  };
@@ -188,6 +188,7 @@ export declare namespace V12 {
188
188
  };
189
189
  heartbeat: {
190
190
  detail_type: 'heartbeat';
191
+ status: ReturnType<Action['getStatus']>;
191
192
  interval: number;
192
193
  };
193
194
  status_update: {
@@ -94,7 +94,8 @@ class V12 extends events_1.EventEmitter {
94
94
  this.heartbeat = setInterval(() => {
95
95
  this.dispatch(V12.formatPayload(this.oneBot.uin, 'heartbeat', {
96
96
  detail_type: "heartbeat",
97
- interval: new Date().getTime() + this.config.heartbeat * 1000
97
+ interval: new Date().getTime() + this.config.heartbeat * 1000,
98
+ status: this.action.getStatus.apply(this)
98
99
  }));
99
100
  }, this.config.heartbeat * 1000);
100
101
  }
@@ -299,7 +300,10 @@ class V12 extends events_1.EventEmitter {
299
300
  if (data.type === 'notice') {
300
301
  switch (data.detail_type) {
301
302
  case 'friend':
302
- data.detail_type += data.sub_type;
303
+ if (['increase', 'decrease'].includes(data.sub_type))
304
+ data.detail_type = 'friend_' + data.sub_type;
305
+ else if (data.sub_type === 'recall')
306
+ data.detail_type = 'private_message_delete';
303
307
  break;
304
308
  case 'group':
305
309
  if (['increase', 'decrease'].includes(data.sub_type))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onebots",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "基于icqq的多例oneBot实现",
5
5
  "engines": {
6
6
  "node": ">=16"
@@ -50,7 +50,7 @@
50
50
  ],
51
51
  "dependencies": {
52
52
  "@koa/router": "^10.1.1",
53
- "icqq": "^0.0.26",
53
+ "icqq": "^0.0.31",
54
54
  "icqq-cq-enable": "^1.0.0",
55
55
  "js-yaml": "^4.1.0",
56
56
  "koa": "^2.13.4",