mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 11:50:42 +00:00
24 lines
635 B
TypeScript
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 } : {}),
|
|
};
|
|
}
|