Files
openclaw/extensions/googlechat/src/monitor-durable.ts
2026-05-06 01:46:42 +01:00

24 lines
635 B
TypeScript

import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
export type GoogleChatDurableReplyOptions = {
to: string;
replyToId?: string;
threadId?: string;
};
export function resolveGoogleChatDurableReplyOptions(params: {
payload: ReplyPayload;
infoKind: string;
spaceId: string;
typingMessageName?: string;
}): GoogleChatDurableReplyOptions | false {
if (params.infoKind !== "final" || params.typingMessageName) {
return false;
}
const threadId = params.payload.replyToId?.trim() || undefined;
return {
to: params.spaceId,
...(threadId ? { replyToId: threadId, threadId } : {}),
};
}