#14224: feat(telegram): add member-info action to get chat administrators
channel: telegram
agents
stale
Cluster:
Messaging Platform Improvements
## Summary
Add support for `member-info` action in Telegram plugin to retrieve chat administrators.
## Changes
- Add `getChatMembersTelegram()` function in `src/telegram/send.ts` using Telegram Bot API `getChatAdministrators`
- Add `memberInfo` action handler in `src/agents/tools/telegram-actions.ts`
- Register `member-info` action in `src/channels/plugins/actions/telegram.ts`
- Add `memberInfo` option to `TelegramActionConfig` type in `src/config/types.telegram.ts`
## Usage
Enable in config:
```yaml
channels:
telegram:
actions:
memberInfo: true
```
Call via message tool:
```
message(action='member-info', channel='telegram', chatId='-1003707749614')
```
## Returns
```json
{
"ok": true,
"chatId": "-1003707749614",
"members": [
{
"id": 123456789,
"username": "admin_user",
"firstName": "Admin",
"lastName": "User",
"isBot": false,
"status": "administrator"
}
]
}
```
## Notes
- Telegram Bot API only provides `getChatAdministrators` (admins with elevated privileges), not a full member list
- Full member enumeration requires Telegram User API (MTProto), which is outside bot scope
- For most tagging use cases, administrators list is sufficient
## Testing
- TypeScript compiles without errors
- Existing Telegram action tests pass
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds a `member-info` action to the Telegram plugin that calls `getChatAdministrators` via the Telegram Bot API and returns a list of admin members. The implementation follows the existing action pattern (config gate, action handler, send function) across four files.
- **Bug**: The action gate default in `handleTelegramAction` (`isActionEnabled("memberInfo")` → defaults to `true`) is inconsistent with `listActions` (`gate("memberInfo", false)` → defaults to `false`). Should pass `false` to match the `sticker` pattern and ensure the action is opt-in.
- The `getChatMembersTelegram` function in `send.ts` correctly reuses the existing retry/error-logging infrastructure.
<h3>Confidence Score: 3/5</h3>
- Low-risk feature addition with one action-gate inconsistency that should be fixed before merge.
- The PR follows existing patterns well and the new functionality is straightforward, but the mismatched default value for the memberInfo action gate means the handler could be invoked even when the feature isn't explicitly enabled in config, bypassing the intended opt-in behavior.
- `src/agents/tools/telegram-actions.ts` — action gate default mismatch
<!-- 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
#11920: Telegram: create forum topics via message tool (thread-create)
by larsderidder · 2026-02-08
77.8%
#12950: feat: add Telegram pin/unpin message support
by alex-muradov · 2026-02-09
77.2%
#14367: feat(telegram): add message read via inbound message store
by michaelquinlan88 · 2026-02-12
76.7%
#7751: Telegram: persist inbound history (SQLite) + add read action
by welttowelt · 2026-02-03
76.4%
#21029: Feature/telegram bot avatar clean
by aleonnet · 2026-02-19
76.3%
#15975: feat(telegram): add Business Mode for personal chat access
by scomma · 2026-02-14
75.1%
#20511: fix: register poll action gate for Telegram adapter (#17528)
by echoVic · 2026-02-19
74.8%
#17441: feat(telegram): add poll action support
by iacosta3994 · 2026-02-15
74.2%
#8310: feat(telegram): Add allowBots support for groups (parity with Disco...
by vishaltandale00 · 2026-02-03
74.0%
#7058: feat(telegram): add channel_post handler for broadcast channels
by waifu7498173 · 2026-02-02
73.8%