mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:21:37 +00:00
refactor: centralize message provider normalization
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from "../infra/outbound/format.js";
|
||||
import { resolveOutboundTarget } from "../infra/outbound/targets.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { normalizeMessageProvider } from "../utils/message-provider.js";
|
||||
|
||||
export async function sendCommand(
|
||||
opts: {
|
||||
@@ -26,8 +27,7 @@ export async function sendCommand(
|
||||
deps: CliDeps,
|
||||
runtime: RuntimeEnv,
|
||||
) {
|
||||
const providerRaw = (opts.provider ?? "whatsapp").toLowerCase();
|
||||
const provider = providerRaw === "imsg" ? "imessage" : providerRaw;
|
||||
const provider = normalizeMessageProvider(opts.provider) ?? "whatsapp";
|
||||
|
||||
if (opts.dryRun) {
|
||||
runtime.log(
|
||||
|
||||
Reference in New Issue
Block a user