Refactor plugin identification to use package name and dirname

Updated plugin manager and API to distinguish between plugin package name and directory name (dirname) for more robust plugin identification and path resolution. Adjusted context creation, status management, and API handlers to use package name for identification and dirname for filesystem operations. Also replaced console.error with console.log in builtin plugin for consistency.
This commit is contained in:
手瓜一十雪 committed 2026-01-28 15:02:47 +08:00
1 parent 93126e514e
commit 0aa0c44634
4 files changed
+46 -68

No files matched your search

+2 -2
View File
@@ -97,7 +97,7 @@ const plugin_onmessage: PluginModule['plugin_onmessage'] = async (_ctx, event) =
console.log('[Plugin: builtin] 已回复版本信息');
} catch (error) {
console.error('[Plugin: builtin] 处理消息时发生错误:', error);
console.log('[Plugin: builtin] 处理消息时发生错误:', error);
}
};
@@ -150,7 +150,7 @@ async function sendMessage (actions: ActionMap, event: OB11Message, message: str
try {
await actions.call('send_msg', params, adapter, config);
} catch (error) {
console.error('[Plugin: builtin] 发送消息失败:', error);
console.log('[Plugin: builtin] 发送消息失败:', error);
}
}