mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 17:40:42 +00:00
Merged via squash.
Prepared head SHA: e8d6738fd0
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
24 lines
787 B
TypeScript
24 lines
787 B
TypeScript
import type { PluginRuntime } from "openclaw/plugin-sdk/channel-core";
|
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
|
|
type DiscordChannelRuntime = {
|
|
messageActions?: typeof import("./channel-actions.js").discordMessageActions;
|
|
sendMessageDiscord?: typeof import("./send.js").sendMessageDiscord;
|
|
};
|
|
|
|
export type DiscordRuntime = PluginRuntime & {
|
|
channel: PluginRuntime["channel"] & {
|
|
discord?: DiscordChannelRuntime;
|
|
};
|
|
};
|
|
|
|
const {
|
|
setRuntime: setDiscordRuntime,
|
|
tryGetRuntime: getOptionalDiscordRuntime,
|
|
getRuntime: getDiscordRuntime,
|
|
} = createPluginRuntimeStore<DiscordRuntime>({
|
|
pluginId: "discord",
|
|
errorMessage: "Discord runtime not initialized",
|
|
});
|
|
export { getDiscordRuntime, getOptionalDiscordRuntime, setDiscordRuntime };
|