refactor: add patch contract helper / 新增 patch contract helper

This commit is contained in:
Alice (OpenClaw)
2026-05-13 16:48:50 +08:00
parent f36643f60c
commit c1eeda3618
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import type { ReplyEndChoice, TelegramInlineButton } from "../types.js"
import { buildTelegramReplyEndAck, buildTelegramReplyEndButtonsForReply, buildTelegramReplyEndButtonsForResolvedChoice } from "./openclaw-telegram-bridge.js"
export type OpenClawTelegramPatchContract = {
defaultButtons: TelegramInlineButton[][]
resolved: Record<ReplyEndChoice, {
buttons: TelegramInlineButton[][]
acknowledgement: string
}>
}
export function buildOpenClawTelegramPatchContract(): OpenClawTelegramPatchContract {
return {
defaultButtons: buildTelegramReplyEndButtonsForReply(),
resolved: {
continue: {
buttons: buildTelegramReplyEndButtonsForResolvedChoice("continue"),
acknowledgement: buildTelegramReplyEndAck("continue"),
},
stop: {
buttons: buildTelegramReplyEndButtonsForResolvedChoice("stop"),
acknowledgement: buildTelegramReplyEndAck("stop"),
},
},
}
}