Skip to content

feat(telegram): add member-info action to get chat administrators#14224

Open
ivan-andreyev wants to merge 1 commit intoopenclaw:mainfrom
ivan-andreyev:feat/telegram-member-info
Open

feat(telegram): add member-info action to get chat administrators#14224
ivan-andreyev wants to merge 1 commit intoopenclaw:mainfrom
ivan-andreyev:feat/telegram-member-info

Conversation

@ivan-andreyev
Copy link

@ivan-andreyev ivan-andreyev commented Feb 11, 2026

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:

channels:
  telegram:
    actions:
      memberInfo: true

Call via message tool:

message(action='member-info', channel='telegram', chatId='-1003707749614')

Returns

{
  "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 Overview

Greptile Summary

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.

Confidence Score: 3/5

  • 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

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

- Add getChatMembersTelegram() function in telegram/send.ts
  using Telegram Bot API getChatAdministrators
- Add memberInfo action handler in telegram-actions.ts
- Register member-info action in actions/telegram.ts
- Add memberInfo option to TelegramActionConfig type

Use case: Agent can call message(action='member-info', chatId='...')
to get list of chat administrators for tagging.

Note: Telegram Bot API only provides getChatAdministrators (admins),
not full member list. Returns: id, username, firstName, lastName,
isBot, status for each administrator.
@openclaw-barnacle openclaw-barnacle bot added channel: telegram Channel integration: telegram agents Agent runtime and tooling labels Feb 11, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

}

if (action === "memberInfo") {
if (!isActionEnabled("memberInfo")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value mismatch: isActionEnabled("memberInfo") defaults to true (enabled), but the corresponding gate("memberInfo", false) in telegram.ts:63 defaults to false (disabled). This means the action won't appear in listActions unless explicitly enabled, but the handler gate will pass even when unconfigured. Should match the sticker pattern and pass false:

Suggested change
if (!isActionEnabled("memberInfo")) {
if (!isActionEnabled("memberInfo", false)) {
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/tools/telegram-actions.ts
Line: 325:325

Comment:
Default value mismatch: `isActionEnabled("memberInfo")` defaults to `true` (enabled), but the corresponding `gate("memberInfo", false)` in `telegram.ts:63` defaults to `false` (disabled). This means the action won't appear in `listActions` unless explicitly enabled, but the handler gate will pass even when unconfigured. Should match the `sticker` pattern and pass `false`:

```suggestion
    if (!isActionEnabled("memberInfo", false)) {
```

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments