{"id":49849075,"url":"https://github.com/JairFC/openclaw-telegram-approval-buttons","last_synced_at":"2026-05-16T11:00:56.628Z","repository":{"id":338709351,"uuid":"1158057303","full_name":"JairFC/openclaw-telegram-approval-buttons","owner":"JairFC","description":"OpenClaw plugin: Inline keyboard buttons for exec approval messages in Telegram","archived":false,"fork":false,"pushed_at":"2026-03-01T14:49:36.000Z","size":2024,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-01T17:54:48.682Z","etag":null,"topics":["approval","exec","inline-keyboard","openclaw","openclaw-extension","plugin","telegram","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JairFC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-14T18:19:33.000Z","updated_at":"2026-03-01T14:49:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/JairFC/openclaw-telegram-approval-buttons","commit_stats":null,"previous_names":["jairfc/openclaw-telegram-approval-buttons"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JairFC/openclaw-telegram-approval-buttons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JairFC%2Fopenclaw-telegram-approval-buttons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JairFC%2Fopenclaw-telegram-approval-buttons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JairFC%2Fopenclaw-telegram-approval-buttons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JairFC%2Fopenclaw-telegram-approval-buttons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JairFC","download_url":"https://codeload.github.com/JairFC/openclaw-telegram-approval-buttons/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JairFC%2Fopenclaw-telegram-approval-buttons/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33100319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["approval","exec","inline-keyboard","openclaw","openclaw-extension","plugin","telegram","typescript"],"created_at":"2026-05-14T14:00:19.876Z","updated_at":"2026-05-16T11:00:56.622Z","avatar_url":"https://github.com/JairFC.png","language":"TypeScript","funding_links":[],"categories":["Skills \u0026 Plugins"],"sub_categories":["Notable Skills \u0026 Plugins"],"readme":"\n--Closed #30695.\n\n\n\n\n# 🔐 Approval Buttons for OpenClaw\n\n\u003e One-tap `exec` approvals in **Telegram** and **Slack** — no more typing `/approve \u003cuuid\u003e allow-once`.\n\n## What does this look like?\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/JairFC/openclaw-telegram-approval-buttons/main/docs/banner.png\" alt=\"Plugin workflow: approval request → allowed → health check\" /\u003e\n\u003c/p\u003e\n\n## What does this do?\n\nOpenClaw's Discord has built-in approval buttons. **Telegram and Slack don't** — you're stuck typing long `/approve` commands. This plugin fixes that for both.\n\n**Features:**\n- ✅ **One-tap approvals** — Allow Once · 🔏 Always · ❌ Deny\n- 💬 **Multi-channel** — works on Telegram (inline keyboard) and Slack (Block Kit buttons)\n- 🔄 **Auto-resolve** — edits the message after decision (removes buttons, shows result)\n- ⏰ **Expiry handling** — stale approvals auto-cleaned and marked as expired\n- 🩺 **Self-diagnostics** — `/approvalstatus` checks health and stats for both channels\n- 🛡️ **Graceful fallback** — if buttons fail, the original text goes through\n- 📦 **Zero dependencies** — uses only Node.js built-in `fetch`\n\n## Quick Start\n\n### Step 1: Install the plugin\n\n```bash\nopenclaw plugins install telegram-approval-buttons\n```\n\nThat's it — OpenClaw downloads it from npm and enables it automatically.\n\n\u003cdetails\u003e\n\u003csummary\u003eAlternative: install from source (for development)\u003c/summary\u003e\n\n```bash\ngit clone https://github.com/JairFC/openclaw-telegram-approval-buttons.git\n```\n\nThen add the path manually to your `openclaw.json`:\n\n```jsonc\n{\n  \"plugins\": {\n    \"load\": {\n      \"paths\": [\"/path/to/openclaw-telegram-approval-buttons\"]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n### Step 2: Configure approvals and plugin\n\nOpen your `~/.openclaw/openclaw.json` and add two things:\n\n1. **Exec approvals targeting Telegram** — without this, approvals stay as plain text\n2. **Plugin config with your bot token and chat ID** — the plugin needs these to send buttons\n\n```jsonc\n{\n  \"approvals\": {\n    \"exec\": {\n      \"enabled\": true,\n      \"mode\": \"targets\",\n      \"targets\": [\n        {\n          \"channel\": \"telegram\",\n          \"to\": \"\u003cyour_telegram_chat_id\u003e\"\n        }\n      ]\n    }\n  },\n  \"plugins\": {\n    \"entries\": {\n      \"telegram-approval-buttons\": {\n        \"enabled\": true,\n        \"config\": {\n          \"botToken\": \"\u003cyour_bot_token\u003e\",\n          \"chatId\": \"\u003cyour_telegram_chat_id\u003e\"\n        }\n      }\n    }\n  }\n}\n```\n\n\u003e 💡 **Where to find these values:**\n\u003e - **Bot token** — the token you got from [@BotFather](https://t.me/BotFather) when creating your bot. It's the same token OpenClaw uses for Telegram.\n\u003e - **Chat ID** — your Telegram user ID. Send a message to [@userinfobot](https://t.me/userinfobot) to get it, or check `openclaw logs --follow` after sending a message to your bot.\n\n### Step 3: Restart and verify\n\n```bash\nopenclaw gateway restart\n```\n\nThen send `/approvalstatus` in your Telegram chat. You should see:\n\n```\n🟢 Approval Buttons Status\n\nTelegram: chatId=✓ · token=✓\n  ✓ connected (@your_bot)\nSlack: not configured\n\nPending: 0 · Processed: 0\nUptime: 1m\n```\n\n\u003e ⚠️ **If you see `DISABLED — missing config`**, the plugin can't find your bot token or chat ID. Double-check that `botToken` and `chatId` are set in `plugins.entries.telegram-approval-buttons.config` in your `~/.openclaw/openclaw.json`.\n\n**That's it!** Next time the AI triggers an `exec` approval, you'll get inline buttons instead of text.\n\n## Prerequisites\n\n- **OpenClaw ≥ 2026.2.9** installed and running\n- **Node.js ≥ 20** (uses built-in `fetch`)\n- **Telegram configured** in your `openclaw.json` (bot token + `allowFrom`)\n- **Exec approvals targeting Telegram** — see Step 2 above\n\n## How it works\n\n```\n┌─────────────┐    message_sending     ┌──────────────────┐\n│  OpenClaw    │ ── approval text ──→  │     Plugin        │\n│  Gateway     │                       │                   │\n│              │   cancel original     │  1. Parse text    │\n│              │ ←──────────────────── │  2. Send buttons  │\n└─────────────┘                        │  3. Track pending │\n                                       └────────┬─────────┘\n                                                │\n                                    Telegram Bot API\n                                                │\n                                       ┌────────▼─────────┐\n                                       │   Telegram Chat   │\n                                       │                   │\n                                       │  🔐 Exec Approval │\n                                       │  [✅ Allow] [🔏]  │\n                                       │  [❌ Deny]        │\n                                       └──────────────────┘\n```\n\nWhen you tap a button, OpenClaw converts the `callback_data` into a synthetic text message — **no webhook needed**.\n\n## Configuration\n\nThe plugin **auto-detects** `botToken` and `chatId` from your Telegram channel config. Most setups need zero extra configuration.\n\n### Config resolution order\n\n| Setting    | Priority 1 (explicit)       | Priority 2 (shared config)         | Priority 3 (env)          |\n|------------|-----------------------------|------------------------------------|---------------------------|\n| `botToken` | `pluginConfig.botToken`     | `channels.telegram.token`          | `TELEGRAM_BOT_TOKEN`      |\n| `chatId`   | `pluginConfig.chatId`       | `channels.telegram.allowFrom[0]`   | `TELEGRAM_CHAT_ID`        |\n\n### Advanced options\n\n```jsonc\n{\n  \"plugins\": {\n    \"entries\": {\n      \"telegram-approval-buttons\": {\n        \"enabled\": true,\n        \"config\": {\n          \"chatId\": \"123456789\",          // Telegram chat ID\n          \"botToken\": \"123:ABC...\",        // Telegram bot token\n          \"slackBotToken\": \"xoxb-...\",     // Slack bot OAuth token (optional)\n          \"slackChannelId\": \"C0123456\",    // Slack channel/DM ID (optional)\n          \"staleMins\": 10,                // Minutes before stale cleanup (default: 10)\n          \"verbose\": false                // Diagnostic logging (default: false)\n        }\n      }\n    }\n  }\n}\n```\n\n## FAQ\n\n**Q: I installed the plugin but I still get old text approvals.**  \nA: Most likely your `approvals.exec` section is missing or doesn't target Telegram. Make sure you have `\"mode\": \"targets\"` with a target pointing to `\"channel\": \"telegram\"` — see Step 2 above. Restart the gateway after changing the config.\n\n**Q: I installed the plugin but no buttons appear at all.**  \nA: Make sure `tools.exec.ask` is NOT set to `\"off\"` in your config. If it's `\"off\"`, there are no approvals to buttonize. Set it to `\"on-miss\"` or `\"always\"`.\n\n**Q: How do I find my Telegram Chat ID?**  \nA: Send `/start` to [@userinfobot](https://t.me/userinfobot) on Telegram — it replies with your ID. Alternatively, check `https://api.telegram.org/bot\u003cTOKEN\u003e/getUpdates` after sending a message to your bot.\n\n**Q: Do I need to set up a webhook?**  \nA: No! OpenClaw's Telegram integration automatically converts button taps into synthetic text messages. No extra setup needed.\n\n**Q: What happens if the plugin fails to send buttons?**  \nA: The original plain-text approval message goes through normally. The plugin never blocks approvals.\n\n**Q: Does this work in group chats?**  \nA: Yes, but the bot needs to be an admin or it needs permission to edit its own messages.\n\n## Troubleshooting\n\n| Problem | Fix |\n|---------|-----|\n| `DISABLED — missing config` in logs | Add `botToken` and `chatId` to `plugins.entries.telegram-approval-buttons.config` in your `~/.openclaw/openclaw.json`. See Step 2. |\n| Still getting old text approvals | Your `approvals.exec` config must target Telegram. See Step 2. |\n| `/approvalstatus` says \"unknown command\" | Plugin didn't load. Run `openclaw plugins install telegram-approval-buttons` and restart the gateway. |\n| No buttons appear | Check `tools.exec.ask` is not `\"off\"`. Run `/approvalstatus` to check config. |\n| Buttons show but nothing happens | Bot needs message editing permission. Use a private chat or make bot admin. |\n| Buttons say \"expired\" | Approval timed out before you tapped. Adjust `staleMins` if needed. |\n\n## Architecture\n\n```\ntelegram-approval-buttons/\n├── index.ts                  # Entry point — orchestration only\n├── types.ts                  # Shared TypeScript interfaces\n├── lib/\n│   ├── telegram-api.ts       # Telegram Bot API client\n│   ├── slack-api.ts          # Slack Web API client\n│   ├── approval-parser.ts    # Parse OpenClaw approval text format\n│   ├── message-formatter.ts  # HTML formatting for Telegram messages\n│   ├── slack-formatter.ts    # Block Kit formatting for Slack messages\n│   ├── approval-store.ts     # In-memory pending approval tracker\n│   └── diagnostics.ts        # Config resolution, health checks\n├── openclaw.plugin.json      # Plugin manifest\n└── package.json\n```\n\n## Contributing\n\nIssues and PRs welcome. Each file in `lib/` is self-contained with a single responsibility.\n\n## Contributors\n\n- [@JairFC](https://github.com/JairFC) — creator and maintainer\n- [@sjkey](https://github.com/sjkey) — Slack support and message simplification (v5.0.0)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJairFC%2Fopenclaw-telegram-approval-buttons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJairFC%2Fopenclaw-telegram-approval-buttons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJairFC%2Fopenclaw-telegram-approval-buttons/lists"}