Handle Telegram poll vote updates for agent context

This commit is contained in:
Krish
2026-02-16 21:19:54 +05:30
committed by Peter Steinberger
parent 5cbfaf5cc7
commit 0a02b91638
6 changed files with 139 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ import { splitTelegramCaption } from "./caption.js";
import { resolveTelegramFetch } from "./fetch.js";
import { renderTelegramHtmlText } from "./format.js";
import { isRecoverableTelegramNetworkError } from "./network-errors.js";
import { recordSentPoll } from "./poll-vote-cache.js";
import { makeProxyFetch } from "./proxy.js";
import { recordSentMessage } from "./sent-message-cache.js";
import { parseTelegramTarget, stripTelegramInternalPrefixes } from "./targets.js";
@@ -1055,6 +1056,15 @@ export async function sendPollTelegram(
if (result?.message_id) {
recordSentMessage(chatId, result.message_id);
}
if (pollId) {
recordSentPoll({
pollId,
chatId: resolvedChatId,
question: normalizedPoll.question,
options: normalizedPoll.options,
accountId: account.accountId,
});
}
recordChannelActivity({
channel: "telegram",