alemonjs 1.0.32 → 1.0.33

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.
@@ -9,6 +9,7 @@ const ApplicationProcessingConfiguration = {
9
9
  type: 'stript',
10
10
  openRegex: /./,
11
11
  closeRegex: undefined,
12
+ event: [],
12
13
  route: '/public/defset',
13
14
  regex: true
14
15
  };
@@ -72,9 +72,11 @@ async function synthesis(AppsObj, appname) {
72
72
  if (!plugins[appname]) {
73
73
  plugins[appname] = [];
74
74
  }
75
+ const shield = getAppProCoinfg('event');
75
76
  for (const item in AppsObj) {
76
- // 解析class
77
77
  const keys = new AppsObj[item]();
78
+ if (shield.find(item => item == keys['event']))
79
+ continue;
78
80
  // 控制类型
79
81
  const eventType = keys['eventType'] ?? 'CREATE';
80
82
  // 不合法
@@ -102,7 +104,6 @@ async function synthesis(AppsObj, appname) {
102
104
  name: appname,
103
105
  APP: AppsObj[item]
104
106
  };
105
- // 指令不存在
106
107
  for await (const key of keys['rule']) {
107
108
  if (!key['fnc'] ||
108
109
  !key['reg'] ||
@@ -70,11 +70,7 @@ export const EventEnum = [
70
70
  /**
71
71
  * 麦克风事件
72
72
  */
73
- 'AUDIO_MICROPHONE',
74
- /**
75
- * 兼容不响应
76
- */
77
- 'notice.*.poke'
73
+ 'AUDIO_MICROPHONE'
78
74
  ];
79
75
  /**
80
76
  * 消息判断
@@ -199,6 +199,12 @@ export async function defineAlemonConfig(Options) {
199
199
  // 加载插件
200
200
  await loadInit();
201
201
  }
202
+ const shieldEvent = Options?.shieldEvent ?? [];
203
+ if (shieldEvent &&
204
+ Array.isArray(Options.shieldEvent) &&
205
+ shieldEvent.every((item) => typeof item === 'string')) {
206
+ setAppProCoinfg('event', shieldEvent);
207
+ }
202
208
  /**
203
209
  * ************
204
210
  * 开始解析
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "DOCS https://alemonjs.com/",
5
5
  "author": "ningmengchongshui",
6
6
  "license": "GPL-2.0",
@@ -27,6 +27,10 @@ interface ApplicationProcessingOpsion {
27
27
  * 是否生成json
28
28
  */
29
29
  regex: boolean;
30
+ /**
31
+ * 事件屏蔽器
32
+ */
33
+ event: string[];
30
34
  }
31
35
  /**
32
36
  * 设置插件解析配置
@@ -28,7 +28,7 @@ export declare const PlatformEnum: readonly ["qq", "kook", "villa", "ntqq", "wec
28
28
  /**
29
29
  * 消息枚举
30
30
  */
31
- export declare const EventEnum: readonly ["GUILD", "CHANNEL", "GUILD_MEMBERS", "MESSAGE_AUDIT", "DIRECT_MESSAGE", "FORUMS_THREAD", "FORUMS_POST", "FORUMS_REPLY", "MESSAGES", "message", "GUILD_MESSAGE_REACTIONS", "INTERACTION", "AUDIO_FREQUENCY", "AUDIO_MICROPHONE", "notice.*.poke"];
31
+ export declare const EventEnum: readonly ["GUILD", "CHANNEL", "GUILD_MEMBERS", "MESSAGE_AUDIT", "DIRECT_MESSAGE", "FORUMS_THREAD", "FORUMS_POST", "FORUMS_REPLY", "MESSAGES", "message", "GUILD_MESSAGE_REACTIONS", "INTERACTION", "AUDIO_FREQUENCY", "AUDIO_MICROPHONE"];
32
32
  /**
33
33
  * 消息判断
34
34
  */
@@ -11,6 +11,10 @@ export interface AlemonOptions {
11
11
  * 是否解析应用
12
12
  */
13
13
  mount?: false;
14
+ /**
15
+ * 事件屏蔽
16
+ */
17
+ shieldEvent?: string[];
14
18
  /**
15
19
  * 个人应用
16
20
  */