openclaw / src /cli /program /message /register.broadcast.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
eb3f11e verified
Raw
History Blame Contribute Delete
844 Bytes
// Message broadcast command registration for multi-target outbound sends.
import type { Command } from "commander";
import { CHANNEL_TARGETS_DESCRIPTION } from "../../../infra/outbound/channel-target.js";
import type { MessageCliHelpers } from "./helpers.js";
/** Register `message broadcast` for sending one payload to multiple channel targets. */
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((options: Record<string, unknown>) => helpers.runMessageAction("broadcast", options));
}