Files
openclaw/src/telegram/reaction-level.ts
2026-02-14 15:39:45 +00:00

29 lines
821 B
TypeScript

import type { OpenClawConfig } from "../config/config.js";
import {
resolveReactionLevel,
type ReactionLevel,
type ResolvedReactionLevel as BaseResolvedReactionLevel,
} from "../utils/reaction-level.js";
import { resolveTelegramAccount } from "./accounts.js";
export type TelegramReactionLevel = ReactionLevel;
export type ResolvedReactionLevel = BaseResolvedReactionLevel;
/**
* Resolve the effective reaction level and its implications.
*/
export function resolveTelegramReactionLevel(params: {
cfg: OpenClawConfig;
accountId?: string;
}): ResolvedReactionLevel {
const account = resolveTelegramAccount({
cfg: params.cfg,
accountId: params.accountId,
});
return resolveReactionLevel({
value: account.config.reactionLevel,
defaultLevel: "minimal",
invalidFallback: "ack",
});
}