diff --git a/src/channels/plugins/outbound/telegram.ts b/src/channels/plugins/outbound/telegram.ts index 9b138705a..6732f5ea0 100644 --- a/src/channels/plugins/outbound/telegram.ts +++ b/src/channels/plugins/outbound/telegram.ts @@ -50,4 +50,24 @@ export const telegramOutbound: ChannelOutboundAdapter = { }); return { channel: "telegram", ...result }; }, + sendPayload: async ({ to, payload, accountId, deps, replyToId, threadId }) => { + const send = deps?.sendTelegram ?? sendMessageTelegram; + const replyToMessageId = parseReplyToMessageId(replyToId); + const messageThreadId = parseThreadId(threadId); + + // Extract Telegram-specific data from channelData + const telegramData = payload.channelData?.telegram as + | { buttons?: Array> } + | undefined; + + const result = await send(to, payload.text ?? "", { + verbose: false, + textMode: "html", + messageThreadId, + replyToMessageId, + accountId: accountId ?? undefined, + buttons: telegramData?.buttons, + }); + return { channel: "telegram", ...result }; + }, };