mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:31:00 +00:00
22 lines
774 B
TypeScript
22 lines
774 B
TypeScript
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
|
|
import { resolveReactionLevel, type ResolvedReactionLevel } from "openclaw/plugin-sdk/text-runtime";
|
|
import { resolveMergedWhatsAppAccountConfig } from "./account-config.js";
|
|
|
|
type ResolvedWhatsAppReactionLevel = ResolvedReactionLevel;
|
|
|
|
/** Resolve the effective reaction level and its implications for WhatsApp. */
|
|
export function resolveWhatsAppReactionLevel(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string;
|
|
}): ResolvedWhatsAppReactionLevel {
|
|
const account = resolveMergedWhatsAppAccountConfig({
|
|
cfg: params.cfg,
|
|
accountId: params.accountId,
|
|
});
|
|
return resolveReactionLevel({
|
|
value: account.reactionLevel,
|
|
defaultLevel: "minimal",
|
|
invalidFallback: "minimal",
|
|
});
|
|
}
|