mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 07:47:39 +00:00
refactor: centralize target errors and cache lookups
This commit is contained in:
@@ -2,6 +2,7 @@ import { chunkText } from "../../../auto-reply/chunk.js";
|
||||
import { sendMessageIMessage } from "../../../imessage/send.js";
|
||||
import { resolveChannelMediaMaxBytes } from "../media-limits.js";
|
||||
import type { ChannelOutboundAdapter } from "../types.js";
|
||||
import { missingTargetError } from "../../../infra/outbound/target-errors.js";
|
||||
|
||||
export const imessageOutbound: ChannelOutboundAdapter = {
|
||||
deliveryMode: "direct",
|
||||
@@ -12,7 +13,7 @@ export const imessageOutbound: ChannelOutboundAdapter = {
|
||||
if (!trimmed) {
|
||||
return {
|
||||
ok: false,
|
||||
error: new Error("Delivering to iMessage requires target <handle|chat_id:ID>"),
|
||||
error: missingTargetError("iMessage", "<handle|chat_id:ID>"),
|
||||
};
|
||||
}
|
||||
return { ok: true, to: trimmed };
|
||||
|
||||
Reference in New Issue
Block a user