#17441: feat(telegram): add poll action support
agents
stale
size: S
Cluster:
Telegram Poll Action Enhancements
## Summary
Wire up `sendPoll` action for Telegram provider using existing `sendPollTelegram` infrastructure.
## Changes
- Add `polls` to `TelegramActionConfig` type (`src/config/types.telegram.ts`)
- Add poll action to telegram actions router - `listActions` + `handleAction` (`src/channels/plugins/actions/telegram.ts`)
- Add `sendPoll` handler to `handleTelegramAction` (`src/agents/tools/telegram-actions.ts`)
## Features
- Question with 2-10 options (Telegram limit)
- Multi-select support (`pollMulti`)
- Duration/timeout
- Anonymous mode
- Forum topic threading
- Silent sends
## Usage
```yaml
channels:
telegram:
actions:
polls: true # Enable poll support
```
Then use via message tool:
```
message action:poll to:CHAT_ID pollQuestion:"Which option?" pollOption:["A","B","C"]
```
## Testing
Verified TypeScript compiles without poll-related errors (other errors are missing dependencies in dev environment).
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Wires up `sendPoll` action for the Telegram provider, reusing the existing `sendPollTelegram` infrastructure from `src/telegram/send.ts`.
- Adds `polls?: boolean` to `TelegramActionConfig` for action gating (enabled by default, consistent with Discord's poll gating pattern)
- Adds `"poll"` to `listActions` and `handleAction` in the Telegram actions router, extracting user-facing params (`pollQuestion`, `pollOption`, `pollMulti`, `pollDurationSeconds`, `pollAnonymous`) and normalizing via `normalizePollInput`
- Adds `"sendPoll"` handler to `handleTelegramAction` that validates the poll object and delegates to `sendPollTelegram`
- Supports Telegram poll features: 2-10 options, multi-select, duration (5-600s), anonymous mode, forum topic threading, and silent sends
- Poll input normalization happens twice (once in the router, once inside `sendPollTelegram`) — redundant but harmless since normalization is idempotent
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — it adds a new opt-in feature using established patterns with no changes to existing behavior.
- The implementation follows existing patterns (sticker actions, Discord polls) closely. All three changed files are additive — no existing behavior is modified. The code correctly delegates to the existing well-tested `sendPollTelegram` function. Downstream validation in `normalizePollInput` and `sendPollTelegram` handles edge cases (option count limits, duration bounds). Score is 4 rather than 5 because the existing test file (`telegram.test.ts`) was not updated with poll action coverage.
- No files require special attention. All changes are additive and follow existing patterns.
<sub>Last reviewed commit: a6f2d24</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#22489: fix(telegram): wire up poll action in dispatch
by pierreeurope · 2026-02-21
91.6%
#17894: fix(telegram): add missing poll action gate with input validation
by PlayerGhost · 2026-02-16
88.9%
#22690: fix: wire up Telegram poll action in provider dispatch
by sleitor · 2026-02-21
87.8%
#20511: fix: register poll action gate for Telegram adapter (#17528)
by echoVic · 2026-02-19
86.2%
#17723: Telegram actions: let poll fall back to core sender
by clzoc · 2026-02-16
85.6%
#17357: feat(telegram): implement telegram poll action,persistent answer ro...
by akyourowngames · 2026-02-15
80.1%
#17294: docs(telegram): add poll CLI example and constraints
by ephelia-ai · 2026-02-15
74.5%
#11920: Telegram: create forum topics via message tool (thread-create)
by larsderidder · 2026-02-08
74.2%
#14224: feat(telegram): add member-info action to get chat administrators
by ivan-andreyev · 2026-02-11
74.2%
#12950: feat: add Telegram pin/unpin message support
by alex-muradov · 2026-02-09
74.1%