feat(telegram): support inline button styles (#18241)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 239cb3552e
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
Ayaan Zaidi
2026-02-16 22:48:47 +05:30
committed by GitHub
parent a177f7b9fe
commit 16327f21da
13 changed files with 155 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ import type { RuntimeEnv } from "../runtime.js";
import type { TelegramMessageContext } from "./bot-message-context.js";
import type { TelegramBotOptions } from "./bot.js";
import type { TelegramStreamMode } from "./bot/types.js";
import type { TelegramInlineButtons } from "./button-types.js";
import { resolveAgentDir } from "../agents/agent-scope.js";
import {
findModelInCatalog,
@@ -300,9 +301,7 @@ export const dispatchTelegramMessage = async ({
const finalText = payload.text;
const currentPreviewText = streamMode === "block" ? draftText : lastPartialText;
const previewButtons = (
payload.channelData?.telegram as
| { buttons?: Array<Array<{ text: string; callback_data: string }>> }
| undefined
payload.channelData?.telegram as { buttons?: TelegramInlineButtons } | undefined
)?.buttons;
let draftStoppedForPreviewEdit = false;
// Skip preview edit for error payloads to avoid overwriting previous content