onebots 0.4.41 → 0.4.42

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/server/app.js CHANGED
@@ -169,7 +169,7 @@ class App extends koa_1.default {
169
169
  this.ws.clients.forEach(client => {
170
170
  client.send(JSON.stringify({
171
171
  event: 'system.log',
172
- data: fs.readFileSync(App.logFile, 'utf8')
172
+ data: (0, utils_1.readLine)(1, App.logFile)
173
173
  }));
174
174
  });
175
175
  };
@@ -189,7 +189,7 @@ class App extends koa_1.default {
189
189
  return adapter.info;
190
190
  }),
191
191
  app: this.info,
192
- logs: fs.existsSync(App.logFile) ? await (0, utils_1.readLine)(100, App.logFile, 'utf8') : ''
192
+ logs: fs.existsSync(App.logFile) ? await (0, utils_1.readLine)(100, App.logFile) : ''
193
193
  }
194
194
  }));
195
195
  client.on('message', async (raw) => {
package/lib/utils.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Dict } from "@zhinjs/shared";
3
3
  import * as fs from "fs";
4
4
  export declare const version: any;
5
- export declare function readLine(maxLen: number, ...params: Parameters<typeof fs.createReadStream>): Promise<string[]>;
5
+ export declare function readLine(maxLen: number, ...params: Parameters<typeof fs.createReadStream>): Promise<string>;
6
6
  export declare function deepMerge(base: any, ...from: any[]): any;
7
7
  export declare function transformObj(obj: any, callback: any): any;
8
8
  export declare function deepClone<T extends any>(obj: T): T;
package/lib/utils.js CHANGED
@@ -42,7 +42,7 @@ function readLine(maxLen, ...params) {
42
42
  result.shift();
43
43
  });
44
44
  rl.on('close', () => {
45
- resolve(result);
45
+ resolve(result.join('\n'));
46
46
  });
47
47
  });
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onebots",
3
- "version": "0.4.41",
3
+ "version": "0.4.42",
4
4
  "description": "基于icqq的多例oneBot实现",
5
5
  "engines": {
6
6
  "node": ">=16"