Skip to content

feat(telegram): add deleteMessage action#903

Closed
sleontenko wants to merge 1 commit intoopenclaw:mainfrom
MyPraxisAI:feature/telegram-delete-message
Closed

feat(telegram): add deleteMessage action#903
sleontenko wants to merge 1 commit intoopenclaw:mainfrom
MyPraxisAI:feature/telegram-delete-message

Conversation

@sleontenko
Copy link
Copy Markdown
Contributor

@sleontenko sleontenko commented Jan 14, 2026

Summary

  • Adds deleteMessage action for Telegram via the message tool
  • Allows bots to delete messages in chats where they have permission

Changes

  • src/telegram/send.ts - Add deleteMessageTelegram function
  • src/agents/tools/telegram-actions.ts - Add deleteMessage action handler
  • src/channels/plugins/actions/telegram.ts - Add delete action to message plugin
  • src/config/types.telegram.ts - Add deleteMessage to TelegramActionConfig
  • src/agents/tools/message-tool.ts - Update description to mention delete

Usage

{
  "tool": "message",
  "action": "delete",
  "chatId": "-1001234567890",
  "messageId": "12345"
}

Can be disabled via config:

{
  "channels": {
    "telegram": {
      "actions": {
        "deleteMessage": false
      }
    }
  }
}

Telegram API Limitations

  • Bot can delete its own messages in any chat
  • Bot can delete others' messages only if admin with "Delete Messages" permission
  • Messages older than 48h in groups may fail to delete

Test plan

  • Delete bot's own message in DM
  • Delete bot's own message in group
  • Verify error when trying to delete others' message without admin rights
  • Verify action can be disabled via config

@sleontenko sleontenko force-pushed the feature/telegram-delete-message branch 2 times, most recently from ea4433a to 8788427 Compare January 14, 2026 20:17
Add ability to delete messages in Telegram chats via the message tool.

Changes:
- Add deleteMessageTelegram function in send.ts
- Add deleteMessage action handler in telegram-actions.ts
- Add delete action support in telegram message plugin adapter
- Add deleteMessage to TelegramActionConfig type
- Update message tool description to mention delete action

Usage:
- Via message tool: action="delete", chatId, messageId
- Can be disabled via channels.telegram.actions.deleteMessage=false

Limitations (Telegram API):
- Bot can delete its own messages in any chat
- Bot can delete others' messages only if admin with "Delete Messages"
- Messages older than 48h in groups may fail to delete
@sleontenko sleontenko force-pushed the feature/telegram-delete-message branch from 8788427 to bd2ddc0 Compare January 14, 2026 20:20
steipete added a commit that referenced this pull request Jan 15, 2026
…leontenko

Co-authored-by: Stan <sleontenko@users.noreply.github.com>
@steipete steipete closed this Jan 15, 2026
@steipete
Copy link
Copy Markdown
Contributor

Landed via temp branch + rebase onto main, then fast-forwarded and pushed.

Changes:

  • wired Telegram delete to accept --to/--channel-id; clarified Telegram message-id errors
  • added deleteMessage tests + gating coverage
  • updated changelog + CLI/Telegram docs

Commits:

Tests:

  • pnpm lint ✅
  • pnpm build ✅
  • pnpm test ❌ (local)
    • src/providers/google-shared.ensures-function-call-comes-after-user-turn.test.ts: "expected undefined to be truthy"
    • src/agents/sandbox-agent-config.agent-specific-sandbox-config.should-allow-agent-specific-docker-settings-beyond.test.ts: timeout 5000ms

Thanks @sleontenko!

zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…hanks @sleontenko

Co-authored-by: Stan <sleontenko@users.noreply.github.com>
heatherstew44-maker pushed a commit to heatherstew44-maker/openclaw that referenced this pull request Mar 8, 2026
…ermanently invisible (openclaw#903)

* tray fix

* format

* Update lib.rs

* Update lib.rs
Fato07 pushed a commit to Fato07/elav that referenced this pull request Mar 26, 2026
Refine heartbeatService to only target runs stuck in "running" state
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…hanks @sleontenko

Co-authored-by: Stan <sleontenko@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…hanks @sleontenko

Co-authored-by: Stan <sleontenko@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants