openclaw/src/cli/program/message/register.broadcast.ts
2026-01-17 03:33:56 +00:00

20 lines
726 B
TypeScript

import type { Command } from "commander";
import { CHANNEL_TARGETS_DESCRIPTION } from "../../../infra/outbound/channel-target.js";
import type { MessageCliHelpers } from "./helpers.js";
export function registerMessageBroadcastCommand(message: Command, helpers: MessageCliHelpers) {
helpers
.withMessageBase(
message.command("broadcast").description("Broadcast a message to multiple targets"),
)
.requiredOption(
"--targets <target...>",
CHANNEL_TARGETS_DESCRIPTION,
)
.option("--message <text>", "Message to send")
.option("--media <url>", "Media URL")
.action(async (options: Record<string, unknown>) => {
await helpers.runMessageAction("broadcast", options);
});
}