mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 06:07:28 +00:00
refactor: dedupe plugin runtime stores
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/telegram";
|
||||
|
||||
let runtime: PluginRuntime | null = null;
|
||||
|
||||
export function setTelegramRuntime(next: PluginRuntime) {
|
||||
runtime = next;
|
||||
}
|
||||
|
||||
export function getTelegramRuntime(): PluginRuntime {
|
||||
if (!runtime) {
|
||||
throw new Error("Telegram runtime not initialized");
|
||||
}
|
||||
return runtime;
|
||||
}
|
||||
const { setRuntime: setTelegramRuntime, getRuntime: getTelegramRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Telegram runtime not initialized");
|
||||
export { getTelegramRuntime, setTelegramRuntime };
|
||||
|
||||
Reference in New Issue
Block a user