onebots 0.1.6 → 0.1.7
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/service/V12/index.js +3 -4
- package/package.json +1 -1
package/lib/service/V12/index.js
CHANGED
|
@@ -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.
|
|
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({
|
|
@@ -583,6 +581,7 @@ exports.V12 = V12;
|
|
|
583
581
|
data['qq'] = Number(data['user_id']);
|
|
584
582
|
if (fileTypes.includes(type) && !data['file']) {
|
|
585
583
|
data['file'] = data['file_id'];
|
|
584
|
+
delete data['file_id'];
|
|
586
585
|
}
|
|
587
586
|
return {
|
|
588
587
|
type: type.replace('mention', 'at').replace('at_all', 'at'),
|