node-karin 0.12.17 → 0.12.19

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.
@@ -144,9 +144,9 @@ export declare class Karin extends Listeners {
144
144
  * @param event - 监听事件
145
145
  * @param fn - 实现函数
146
146
  */
147
- accept<T extends keyof AcceptDict>(event: T, fn: (e: AcceptDict[T]) => boolean, options?: Options): {
147
+ accept<T extends keyof AcceptDict>(event: T, fn: (e: AcceptDict[T]) => Promise<boolean>, options?: Options): {
148
148
  event: T;
149
- fn: (e: AcceptDict[T]) => boolean;
149
+ fn: (e: AcceptDict[T]) => Promise<boolean>;
150
150
  log: (id: string, text: string) => void;
151
151
  name: string;
152
152
  rank: number;
@@ -316,6 +316,8 @@ class PluginLoader {
316
316
  /** 函数语法糖数组 */
317
317
  if (Array.isArray(Fn)) {
318
318
  for (const Val of Fn) {
319
+ if (typeof Val !== 'object' || !Val?.type)
320
+ continue;
319
321
  logger.debug(`载入插件 [${plugin}]${_path ? `${common.getRelPath(_path)}` : ''}[${file}][${Val.name}]`);
320
322
  list.push(this.cachePlugin(index, plugin, file, Val));
321
323
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "0.12.17",
3
+ "version": "0.12.19",
4
4
  "private": false,
5
5
  "description": "基于 Kritor 进行开发的nodejs机器人框架",
6
6
  "homepage": "https://github.com/KarinJS/Karin",