alemonjs 1.1.27 → 1.1.29
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/core/dealmsg.js +7 -9
- package/package.json +1 -1
- package/types/define/types.d.ts +27 -26
package/lib/core/dealmsg.js
CHANGED
|
@@ -332,19 +332,18 @@ export async function InstructionMatching(e) {
|
|
|
332
332
|
await user_handler(e, user_state);
|
|
333
333
|
return true;
|
|
334
334
|
}
|
|
335
|
-
let t =
|
|
335
|
+
let t = true;
|
|
336
336
|
/**
|
|
337
337
|
* 回调系统
|
|
338
338
|
*/
|
|
339
339
|
for (const app of getAppCall('MESSAGES')) {
|
|
340
|
-
if (t ===
|
|
340
|
+
if (t === false)
|
|
341
341
|
break;
|
|
342
342
|
try {
|
|
343
343
|
// app.call
|
|
344
344
|
const back = await app.call(e);
|
|
345
|
-
if (back
|
|
346
|
-
t =
|
|
347
|
-
}
|
|
345
|
+
if (back != false)
|
|
346
|
+
t = false;
|
|
348
347
|
}
|
|
349
348
|
catch (err) {
|
|
350
349
|
console.error(`[${e.event}]`, `[${app.call}]`, `[${false}]\n`, `[${err}]`);
|
|
@@ -355,14 +354,13 @@ export async function InstructionMatching(e) {
|
|
|
355
354
|
* 回调系统
|
|
356
355
|
*/
|
|
357
356
|
for (const app of getAppCall('message')) {
|
|
358
|
-
if (t ===
|
|
357
|
+
if (t === false)
|
|
359
358
|
break;
|
|
360
359
|
try {
|
|
361
360
|
// app.call
|
|
362
361
|
const back = await app.call(e);
|
|
363
|
-
if (back
|
|
364
|
-
t =
|
|
365
|
-
}
|
|
362
|
+
if (back != false)
|
|
363
|
+
t = false;
|
|
366
364
|
}
|
|
367
365
|
catch (err) {
|
|
368
366
|
console.error(`[${e.event}]`, `[${app.call}]`, `[${false}]\n`, `[${err}]`);
|
package/package.json
CHANGED
package/types/define/types.d.ts
CHANGED
|
@@ -2,6 +2,32 @@ import { PuppeteerLaunchOptions } from 'puppeteer';
|
|
|
2
2
|
import { LoginOptions } from '../default/types.js';
|
|
3
3
|
import { MysqlOptions, RedisOptions } from '../default/types.js';
|
|
4
4
|
import { ServerOptions } from '../koa/types.js';
|
|
5
|
+
export interface PlatformsItemType {
|
|
6
|
+
/**
|
|
7
|
+
* 机器人名称与login对应
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* 登录
|
|
12
|
+
*/
|
|
13
|
+
call: (options: any) => {
|
|
14
|
+
/**
|
|
15
|
+
* 事件
|
|
16
|
+
* @param event
|
|
17
|
+
* @param func 函数
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
event: (event: string, func: any) => void;
|
|
21
|
+
/**
|
|
22
|
+
* 消息配置
|
|
23
|
+
*/
|
|
24
|
+
message: {
|
|
25
|
+
type: string;
|
|
26
|
+
val: any;
|
|
27
|
+
}[];
|
|
28
|
+
controlller: any;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
5
31
|
/**
|
|
6
32
|
* ******
|
|
7
33
|
* config
|
|
@@ -15,32 +41,7 @@ export interface AlemonOptions {
|
|
|
15
41
|
/**
|
|
16
42
|
* 平台
|
|
17
43
|
*/
|
|
18
|
-
platforms?:
|
|
19
|
-
/**
|
|
20
|
-
* 机器人名称与login对应
|
|
21
|
-
*/
|
|
22
|
-
name: string;
|
|
23
|
-
/**
|
|
24
|
-
* 登录
|
|
25
|
-
*/
|
|
26
|
-
call: (options: any) => {
|
|
27
|
-
/**
|
|
28
|
-
* 事件
|
|
29
|
-
* @param event
|
|
30
|
-
* @param func 函数
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
event: (event: string, func: any) => void;
|
|
34
|
-
/**
|
|
35
|
-
* 消息配置
|
|
36
|
-
*/
|
|
37
|
-
message: {
|
|
38
|
-
type: string;
|
|
39
|
-
val: any;
|
|
40
|
-
}[];
|
|
41
|
-
controlller: any;
|
|
42
|
-
};
|
|
43
|
-
}[];
|
|
44
|
+
platforms?: PlatformsItemType[];
|
|
44
45
|
/**
|
|
45
46
|
* login配置
|
|
46
47
|
*/
|