onebots 0.1.6 → 0.1.8

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.
@@ -367,9 +367,6 @@ class V12 extends events_1.EventEmitter {
367
367
  if (Reflect.has(params, k)) {
368
368
  if (onebot_1.BOOLS.includes(k))
369
369
  params[k] = (0, utils_2.toBool)(params[k]);
370
- if (k === 'message') {
371
- params[k] = V12.fromSegment(params[k]);
372
- }
373
370
  args.push(params[k]);
374
371
  }
375
372
  }
@@ -460,7 +457,7 @@ class V12 extends events_1.EventEmitter {
460
457
  return;
461
458
  const action = event.detail_type === "private" ? "sendPrivateMsg" : "sendGroupMsg";
462
459
  const id = event.detail_type === "private" ? event.user_id : event.group_id;
463
- this.client[action](id, res.reply, res.auto_escape);
460
+ this.action[action].apply(this, [id, res.reply]);
464
461
  }
465
462
  if (event.detail_type === "group") {
466
463
  if (res.delete)
@@ -545,6 +542,7 @@ class V12 extends events_1.EventEmitter {
545
542
  }
546
543
  else {
547
544
  code = 10003;
545
+ this.logger.debug(e);
548
546
  message = "请求格式错误";
549
547
  }
550
548
  ws.send(JSON.stringify({
@@ -558,8 +556,15 @@ class V12 extends events_1.EventEmitter {
558
556
  }));
559
557
  }
560
558
  });
561
- this.dispatch(V12.formatPayload(this.oneBot.uin, "connect", this.action.getVersion.apply(this)));
562
- this.dispatch(V12.formatPayload(this.oneBot.uin, "status_update", this.action.getStatus.apply(this)));
559
+ this.dispatch(V12.formatPayload(this.oneBot.uin, "connect", {
560
+ detail_type: "connect",
561
+ type: 'meta',
562
+ version: this.action.getVersion.apply(this)
563
+ }));
564
+ this.dispatch(V12.formatPayload(this.oneBot.uin, "status_update", {
565
+ detail_type: 'status_update',
566
+ status: this.action.getStatus.apply(this)
567
+ }));
563
568
  }
564
569
  }
565
570
  exports.V12 = V12;
@@ -583,6 +588,7 @@ exports.V12 = V12;
583
588
  data['qq'] = Number(data['user_id']);
584
589
  if (fileTypes.includes(type) && !data['file']) {
585
590
  data['file'] = data['file_id'];
591
+ delete data['file_id'];
586
592
  }
587
593
  return {
588
594
  type: type.replace('mention', 'at').replace('at_all', 'at'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onebots",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "基于icqq的多例oneBot实现",
5
5
  "engines": {
6
6
  "node": ">=16"