{"id":15759312,"url":"https://github.com/wechaty/puppet-official-account","last_synced_at":"2026-03-14T05:03:20.981Z","repository":{"id":46712904,"uuid":"284473625","full_name":"wechaty/puppet-official-account","owner":"wechaty","description":"Wechaty Puppet for WeChat Official Account","archived":false,"fork":false,"pushed_at":"2025-01-23T07:59:27.000Z","size":359,"stargazers_count":17,"open_issues_count":4,"forks_count":6,"subscribers_count":95,"default_branch":"main","last_synced_at":"2025-09-27T05:57:17.637Z","etag":null,"topics":["oa","puppet","wechat","wechaty"],"latest_commit_sha":null,"homepage":"https://wechaty.js.org/2020/11/06/wechaty-puppet-oa-released-en/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wechaty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-02T14:05:47.000Z","updated_at":"2025-01-23T07:59:31.000Z","dependencies_parsed_at":"2024-01-23T21:15:49.380Z","dependency_job_id":"a1ade14b-03b6-48e2-a53a-2b87f5102b67","html_url":"https://github.com/wechaty/puppet-official-account","commit_stats":null,"previous_names":["wechaty/wechaty-puppet-official-account"],"tags_count":0,"template":false,"template_full_name":"wechaty/puppet-mock","purl":"pkg:github/wechaty/puppet-official-account","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-official-account","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-official-account/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-official-account/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-official-account/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wechaty","download_url":"https://codeload.github.com/wechaty/puppet-official-account/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-official-account/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30452878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T21:31:01.033Z","status":"ssl_error","status_checked_at":"2026-03-12T21:30:43.161Z","response_time":114,"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":["oa","puppet","wechat","wechaty"],"created_at":"2024-10-04T10:04:42.899Z","updated_at":"2026-03-13T01:02:00.331Z","avatar_url":"https://github.com/wechaty.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PUPPET-OFFICIAL-ACCOUNT\n\n[![NPM Version](https://badge.fury.io/js/wechaty-puppet-official-account.svg)](https://badge.fury.io/js/wechaty-puppet-official-account)\n[![npm (tag)](https://img.shields.io/npm/v/wechaty-puppet-official-account/next.svg)](https://www.npmjs.com/package/wechaty-puppet-official-account?activeTab=versions)\n[![NPM](https://github.com/wechaty/wechaty-puppet-official-account/workflows/NPM/badge.svg)](https://github.com/wechaty/wechaty-puppet-official-account/actions?query=workflow%3ANPM)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![WeChat Official Account Puppet for Wechaty](docs/images/wechaty-puppet-official-account.png)\n\n[![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-brightgreen.svg)](https://github.com/wechaty/wechaty)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\nWechaty Puppet for WeChat Official Accounts helps you use Wechaty to manage your Official Account from \u003chttps://mp.weixin.qq.com\u003e.\n\n## FEATURES\n\n1. Provide webhook proxy out-of-the-box (powered by [localtunnel](https://github.com/localtunnel/localtunnel))\n\n## USAGE\n\nThis documentation assumes that you are familiar with Wechaty already.\n\nIf you are a newbie to Wechaty, please read the following two links first:\n\n1. [Wechaty WebSite](https://wechaty.js.org)\n1. [Wechaty Getting Started](https://github.com/wechaty/wechaty-getting-started)\n\nTo use `wechaty-puppet-official-account` with Wechaty, just like other puppets as well:\n\n```ts\nimport { Wechaty }  from 'wechaty'\nimport { PuppetOA } from 'wechaty-puppet-official-account'\n\nconst oa = new PuppetOA({\n  appId           : OA_APP_ID,\n  appSecret       : OA_APP_SECRET,\n  token           : OA_TOKEN,\n  webhookProxyUrl : 'https://aeb082b9-14da-4c91-bdef-90a6d17a4z98.localtunnel.me',\n})\n\nconst bot = new Wechaty({\n  name: 'oa-bot',\n  puppet: oa,\n})\n\nbot.on('message', msg =\u003e {\n  if (!msg.self() \u0026\u0026 msg.type() === bot.Message.Type.Text \u0026\u0026 /ding/i.test(msg.text())) {\n    await msg.say('dong')\n  }\n})\nawait bot.start()\n```\n\n\u003e For the full source code, see: \u003cexamples/ding-dong-bot.ts\u003e\n\nThat's it!\n\n## ENVIRONMENTS VARIABLES\n\nYou can use environment variables to configure all of the WeChat Official Account Development Information.\n\n### `WECHATY_PUPPET_OA_APP_ID`: `appId`\n\nDeveloper ID(AppID) is the developer ID, Official Account identification code, which can call Official Account API with the developer's password.\n\n### `WECHATY_PUPPET_OA_APP_SECRET`: `appSecret`\n\nThe Developer Password(AppSecret) is the one with high security to verify the identity of the Official Account developer.\n\n### `WECHATY_PUPPET_OA_TOKEN`: `token`\n\nThe token is set by you for your server(URL) configuration.\n\n### `WECHATY_PUPPET_OA_PORT`\n\nSet `WECHATY_PUPPET_OA_PORT` to your local HTTP Server port number if you have a public server that can be visited from the internet.\n\nAfter setting ``WECHATY_PUPPET_OA_PORT`, the puppet will expose itself to the internet with this port for providing the HTTP service.\n\n### `WECHATY_PUPPET_OA_WEBHOOK_PROXY_URL`\n\nSet `WECHATY_PUPPET_OA_WEBHOOK_PROXY_URL` to a `localtunnel` supported address so that you will be able to provide the Server Address(URL) for WebHook usage with this URL.\n\nThis is the most convenient way to use this puppet because you can always provide the same URL to the WeChat Official Account platform no matter where your program is running.\n\nCurrently, you can generate this URL by yourself by:\n\n1. Generate a UUIDv4 use a generator like [UUID Online Generator](https://uuidonline.com)\n1. Insert your $UUID to `https://${UUID}.localtunnel.me`\n\nFor example, if your UUID is `aeb082b9-14da-4c91-bdef-90a6d17a4z98`, then you can use `https://aeb082b9-14da-4c91-bdef-90a6d17a4z98.localtunnel.me` as `WECHATY_PUPPET_OA_WEBHOOK_PROXY_URL`\n\nLearn more from [localtunnel](https://localtunnel.github.io/www/)\n\n## DEVELOPMENT\n\nWhen you start developing the WeChat Official Account, it will be very helpful with the following tools provided by Tencent:\n\n1. Apply a test Official Account with full privileges for developing\n1. Simulate the API calls in an online simulation tool.\n\n### 1 Apply an Official Account for developing/testing\n\n测试号是扫码即可获得的微信公众号，拥有所有完整高级接口权限，测试专用。\n\n微信公众帐号测试号申请系统入口地址:\n\n- [Docs](https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Requesting_an_API_Test_Account.html)\n- [Link](https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login)\n\n### 2 API calls debugging tool\n\n允许开发者在平台上提交信息和服务器进行交互，并得到验证结果的在线 API 调试工具。\n\nAddress: \u003chttps://mp.weixin.qq.com/debug/\u003e\n\n## RESOURCES\n\n- [nodejs+express对微信公众号进行二次开发--接收消息，自动回复文本，图片以及代码优化](https://blog.csdn.net/weixin_44729896/article/details/102525375)\n- [Microsoft Azure Bot Service - Connect a bot to WeChat](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-wechat?view=azure-bot-service-4.0)\n\n## HISTORY\n\n### master v1.0 Release (Oct 29, 2021)\n\n1. v0.9 (Oct 2021): Puppet API v0.51\n1. v0.7 (Sep 2021): Enable ES Module support for Node.js\n\n### v0.4 (Aug 6, 2020)\n\n1. Support localtunnel service from any service provider (domains).\n\n### v0.2 (Aug 2, 2018)\n\nInitial version for Official Account.\n\n1. receive messages from users\n1. reply message to a user (passive mode)\n\n## Maintainers\n\n- Admins\n  - [@huan](https://github.com/huan) Huan\n  - [@leochen-g](https://wechaty.js.org/contributors/leochen-g/) Leo chen\n- Contributors\n  - [@wj-Mcat](https://github.com/wj-Mcat)\n  - [@qhduan](https://github.com/qhduan)\n\n## COPYRIGHT \u0026 LICENSE\n\n- Code \u0026 Docs © 2020-now Wechaty Organization\n- Code released under the Apache-2.0 License\n- Docs released under Creative Commons\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwechaty%2Fpuppet-official-account","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwechaty%2Fpuppet-official-account","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwechaty%2Fpuppet-official-account/lists"}