onebots 0.0.16 → 0.0.17
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 +7 -1
- package/package.json +1 -1
package/lib/service/V12/index.js
CHANGED
|
@@ -190,8 +190,14 @@ class V12 extends events_1.EventEmitter {
|
|
|
190
190
|
startWsReverse(config) {
|
|
191
191
|
const ws = this._createWsr(config.url, config);
|
|
192
192
|
this.on('dispatch', (unserialized) => {
|
|
193
|
+
const serialized = JSON.stringify(unserialized);
|
|
193
194
|
if (this.wsr.has(ws)) {
|
|
194
|
-
ws.send(
|
|
195
|
+
ws.send(serialized, (err) => {
|
|
196
|
+
if (err)
|
|
197
|
+
this.logger.error(`反向WS(${ws.url})上报事件失败: ` + err.message);
|
|
198
|
+
else
|
|
199
|
+
this.logger.debug(`反向WS(${ws.url})上报事件成功: ` + serialized);
|
|
200
|
+
});
|
|
195
201
|
}
|
|
196
202
|
});
|
|
197
203
|
}
|