mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-08 23:15:05 +00:00
fix(matrix): keep plugin register sync while bootstrapping crypto runtime (#31989)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
||||
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
|
||||
import { matrixPlugin } from "./src/channel.js";
|
||||
import { ensureMatrixCryptoRuntime } from "./src/matrix/deps.js";
|
||||
import { setMatrixRuntime } from "./src/runtime.js";
|
||||
|
||||
@@ -8,10 +9,12 @@ const plugin = {
|
||||
name: "Matrix",
|
||||
description: "Matrix channel plugin (matrix-js-sdk)",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
async register(api: OpenClawPluginApi) {
|
||||
register(api: OpenClawPluginApi) {
|
||||
setMatrixRuntime(api.runtime);
|
||||
await ensureMatrixCryptoRuntime();
|
||||
const { matrixPlugin } = await import("./src/channel.js");
|
||||
void ensureMatrixCryptoRuntime({ log: api.logger.info }).catch((err) => {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
api.logger.warn?.(`matrix: crypto runtime bootstrap failed: ${message}`);
|
||||
});
|
||||
api.registerChannel({ plugin: matrixPlugin });
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user