onebots 0.4.44 → 0.4.45
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/adapters/icqq/index.js +1 -1
- package/lib/server/app.d.ts +3 -3
- package/lib/server/app.js +9 -6
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ async function processMessages(uin, target_id, target_type, list) {
|
|
|
57
57
|
result.push({
|
|
58
58
|
type,
|
|
59
59
|
...data,
|
|
60
|
-
message: await processMessages.call(this, uin, data.user_id, 'private', data.
|
|
60
|
+
message: await processMessages.call(this, uin, data.user_id, 'private', data.content || [])
|
|
61
61
|
});
|
|
62
62
|
break;
|
|
63
63
|
}
|
package/lib/server/app.d.ts
CHANGED
|
@@ -29,12 +29,12 @@ export declare class App extends Koa {
|
|
|
29
29
|
httpServer: Server;
|
|
30
30
|
logger: Logger;
|
|
31
31
|
static configDir: string;
|
|
32
|
-
static configPath: string;
|
|
33
|
-
static dataDir: string;
|
|
32
|
+
static get configPath(): string;
|
|
33
|
+
static get dataDir(): string;
|
|
34
|
+
static get logFile(): string;
|
|
34
35
|
adapters: Map<string, Adapter>;
|
|
35
36
|
ws: WsServer;
|
|
36
37
|
router: Router;
|
|
37
|
-
static logFile: string;
|
|
38
38
|
get info(): {
|
|
39
39
|
system_platform: NodeJS.Platform;
|
|
40
40
|
system_arch: NodeJS.Architecture;
|
package/lib/server/app.js
CHANGED
|
@@ -46,6 +46,15 @@ const path = __importStar(require("path"));
|
|
|
46
46
|
const process_1 = __importDefault(require("process"));
|
|
47
47
|
const fs = __importStar(require("fs"));
|
|
48
48
|
class App extends koa_1.default {
|
|
49
|
+
static get configPath() {
|
|
50
|
+
return path.join(App.configDir, 'config.yaml');
|
|
51
|
+
}
|
|
52
|
+
static get dataDir() {
|
|
53
|
+
return path.join(App.configDir, 'data');
|
|
54
|
+
}
|
|
55
|
+
static get logFile() {
|
|
56
|
+
return path.join(App.configDir, 'onebots.log');
|
|
57
|
+
}
|
|
49
58
|
get info() {
|
|
50
59
|
const pkg = require(path.resolve(__dirname, '../../package.json'));
|
|
51
60
|
const free_memory = os.freemem();
|
|
@@ -292,15 +301,10 @@ class App extends koa_1.default {
|
|
|
292
301
|
}
|
|
293
302
|
exports.App = App;
|
|
294
303
|
App.configDir = path.join(os.homedir(), '.onebots');
|
|
295
|
-
App.configPath = path.join(App.configDir, 'config.yaml');
|
|
296
|
-
App.dataDir = path.join(App.configDir, 'data');
|
|
297
|
-
App.logFile = path.join(App.configDir, 'onebots.log');
|
|
298
304
|
function createOnebots(config = 'config.yaml', cp) {
|
|
299
305
|
if (typeof config === 'string') {
|
|
300
306
|
config = path.resolve(process_1.default.cwd(), config);
|
|
301
307
|
App.configDir = path.dirname(config);
|
|
302
|
-
App.configPath = config;
|
|
303
|
-
App.dataDir = path.join(App.configDir, 'data');
|
|
304
308
|
if (!(0, fs_1.existsSync)(App.configDir)) {
|
|
305
309
|
(0, fs_1.mkdirSync)(App.configDir);
|
|
306
310
|
}
|
|
@@ -308,7 +312,6 @@ function createOnebots(config = 'config.yaml', cp) {
|
|
|
308
312
|
(0, fs_1.mkdirSync)(App.dataDir);
|
|
309
313
|
console.log('以为你创建数据存储目录', App.dataDir);
|
|
310
314
|
}
|
|
311
|
-
App.configPath = path.resolve(App.configDir, config);
|
|
312
315
|
if (!(0, fs_1.existsSync)(App.configPath)) {
|
|
313
316
|
(0, fs_1.copyFileSync)(path.resolve(__dirname, '../config.sample.yaml'), App.configPath);
|
|
314
317
|
console.log('未找到对应配置文件,已自动生成默认配置文件,请修改配置文件后重新启动');
|