openclaw/src/channels/plugins/actions/reaction-message-id.ts
2026-03-02 23:16:47 +00:00

13 lines
404 B
TypeScript

import { readStringOrNumberParam } from "../../../agents/tools/common.js";
type ReactionToolContext = {
currentMessageId?: string | number;
};
export function resolveReactionMessageId(params: {
args: Record<string, unknown>;
toolContext?: ReactionToolContext;
}): string | number | undefined {
return readStringOrNumberParam(params.args, "messageId") ?? params.toolContext?.currentMessageId;
}