node-karin 0.11.5 → 0.11.6
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.
|
@@ -319,8 +319,6 @@ class PluginLoader {
|
|
|
319
319
|
rootPath = rootPath + `?${Date.now()}`;
|
|
320
320
|
const tmp = await import(rootPath);
|
|
321
321
|
lodash.forEach(tmp, (Fn) => {
|
|
322
|
-
const index = this.index;
|
|
323
|
-
this.index++;
|
|
324
322
|
/** 函数语法糖 */
|
|
325
323
|
if (typeof Fn === 'object' && Fn?.type) {
|
|
326
324
|
logger.debug(`载入插件 [${plugin}]${_path ? `${common.getRelPath(_path)}` : ''}[${file}][${Fn.name}]`);
|
|
@@ -71,12 +71,13 @@ export class NoticeHandler extends EventBaseHandler {
|
|
|
71
71
|
continue;
|
|
72
72
|
/** 日志方法字符串 */
|
|
73
73
|
this.e.logFnc = `[${info.name}][accept]`;
|
|
74
|
-
const logFnc = logger.fnc(this.e.logFnc);
|
|
74
|
+
const logFnc = logger.fnc(this.e.logFnc + `[${this.e.event}.${this.e.sub_event}]`);
|
|
75
|
+
this.GroupMsgPrint && info.log(this.e.self_id, `${logFnc + this.e.logText} 开始处理`);
|
|
75
76
|
/** 计算插件处理时间 */
|
|
76
77
|
const start = Date.now();
|
|
77
78
|
try {
|
|
78
79
|
const res = await info.fn(this.e);
|
|
79
|
-
this.GroupMsgPrint &&
|
|
80
|
+
this.GroupMsgPrint && info.log(this.e.self_id, `${logFnc} 处理完成 ${logger.green(Date.now() - start + 'ms')}`);
|
|
80
81
|
if (res !== false)
|
|
81
82
|
break;
|
|
82
83
|
}
|
|
@@ -66,12 +66,13 @@ export class RequestHandler extends EventBaseHandler {
|
|
|
66
66
|
continue;
|
|
67
67
|
/** 日志方法字符串 */
|
|
68
68
|
this.e.logFnc = `[${info.name}][accept]`;
|
|
69
|
-
const logFnc = logger.fnc(this.e.logFnc);
|
|
69
|
+
const logFnc = logger.fnc(this.e.logFnc + `[${this.e.event}.${this.e.sub_event}]`);
|
|
70
|
+
this.GroupMsgPrint && info.log(this.e.self_id, `${logFnc + this.e.logText} 开始处理`);
|
|
70
71
|
/** 计算插件处理时间 */
|
|
71
72
|
const start = Date.now();
|
|
72
73
|
try {
|
|
73
74
|
const res = await info.fn(this.e);
|
|
74
|
-
this.GroupMsgPrint &&
|
|
75
|
+
this.GroupMsgPrint && info.log(this.e.self_id, `${logFnc} 处理完成 ${logger.green(Date.now() - start + 'ms')}`);
|
|
75
76
|
if (res !== false)
|
|
76
77
|
break;
|
|
77
78
|
}
|