{"id":13834659,"url":"https://github.com/node-webot/co-wechat-api","last_synced_at":"2025-04-08T02:38:51.590Z","repository":{"id":22912785,"uuid":"26261584","full_name":"node-webot/co-wechat-api","owner":"node-webot","description":"Wechat API. Support Async Functions","archived":false,"fork":false,"pushed_at":"2022-08-01T08:20:53.000Z","size":2874,"stargazers_count":723,"open_issues_count":27,"forks_count":170,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-10-29T21:39:28.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-webot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-06T08:52:34.000Z","updated_at":"2024-08-05T18:19:34.000Z","dependencies_parsed_at":"2022-08-23T04:40:32.797Z","dependency_job_id":null,"html_url":"https://github.com/node-webot/co-wechat-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fco-wechat-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fco-wechat-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fco-wechat-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-webot%2Fco-wechat-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-webot","download_url":"https://codeload.github.com/node-webot/co-wechat-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247766873,"owners_count":20992536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-04T14:00:49.390Z","updated_at":"2025-04-08T02:38:51.574Z","avatar_url":"https://github.com/node-webot.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","12. GitHub"],"sub_categories":["Electron"],"readme":"Wechat API(ES6版)\n===========\n微信公共平台API。\n\n## 模块状态\n- [![NPM version](https://badge.fury.io/js/co-wechat-api.png)](http://badge.fury.io/js/co-wechat-api)\n- [![Build Status](https://travis-ci.org/node-webot/co-wechat-api.png?branch=master)](https://travis-ci.org/node-webot/co-wechat-api)\n- [![Dependencies Status](https://david-dm.org/node-webot/co-wechat-api.png)](https://david-dm.org/node-webot/co-wechat-api)\n- [![Coverage Status](https://coveralls.io/repos/node-webot/co-wechat-api/badge.png)](https://coveralls.io/r/node-webot/co-wechat-api)\n\n## 功能列表\n- 发送客服消息（文本、图片、语音、视频、音乐、图文、小程序卡片）\n- 菜单操作（查询、创建、删除、个性化菜单）\n- 二维码（创建临时、永久二维码，查看二维码URL）\n- 分组操作（查询、创建、修改、移动用户到分组）\n- 用户信息（查询用户基本信息、获取关注者列表）\n- 媒体文件（上传、获取）\n- 群发消息（文本、图片、语音、视频、图文）\n- 客服记录（查询客服记录，查看客服、查看在线客服）\n- 群发消息\n- 公众号支付（发货通知、订单查询）\n- 微信小店（商品管理、库存管理、邮费模板管理、分组管理、货架管理、订单管理、功能接口）\n- 模版消息\n- 网址缩短\n- 语义查询\n- 数据分析\n- JSSDK服务端支持\n- 素材管理\n- 摇一摇周边\n- 小程序订阅消息（暂仅支持发送）\n\n详细参见[API文档](http://doxmate.cool/node-webot/co-wechat-api/api.html)\n\n企业版本请前往：\u003chttps://github.com/node-webot/wechat-enterprise\u003e\n\n## Installation\n\n```sh\n$ npm install co-wechat-api\n```\n\n## Usage\n\n```js\nvar WechatAPI = require('co-wechat-api');\n\nasync function() {\n  var api = new WechatAPI(appid, appsecret);\n  var result = await api.updateRemark('open_id', 'remarked');\n}\n```\n\n### 多进程\n当多进程时，token需要全局维护，以下为保存token的接口：\n\n```js\nvar api = new API('appid', 'secret', async function () {\n  // 传入一个获取全局token的方法\n  var txt = await fs.readFile('access_token.txt', 'utf8');\n  return JSON.parse(txt);\n}, async function (token) {\n  // 请将token存储到全局，跨进程、跨机器级别的全局，比如写到数据库、redis等\n  // 这样才能在cluster模式及多机情况下使用，以下为写入到文件的示例\n  await fs.writeFile('access_token.txt', JSON.stringify(token));\n});\n```\n\n## Show cases\n### Node.js API自动回复\n\n![Node.js API自动回复机器人](http://nodeapi.diveintonode.org/assets/qrcode.jpg)\n\n欢迎关注。\n\n代码：\u003chttps://github.com/JacksonTian/api-doc-service\u003e\n\n你可以在[CloudFoundry](http://www.cloudfoundry.com/)、[appfog](https://www.appfog.com/)、[BAE](http://developer.baidu.com/wiki/index.php?title=docs/cplat/rt/node.js)等搭建自己的机器人。\n\n## 详细API\n原始API文档请参见：[消息接口指南](http://mp.weixin.qq.com/wiki/index.php?title=消息接口指南)。\n## License\nThe MIT license.\n\n## 交流群\nQQ群：157964097，使用疑问，开发，贡献代码请加群。\n\n## 感谢\n感谢以下贡献者：\n\n```\n\n project  : co-wechat-api\n repo age : 2 years, 6 months\n active   : 37 days\n commits  : 109\n files    : 50\n authors  :\n    75  Jackson Tian  68.8%\n     7  肥鼠          6.4%\n     6  magicxie      5.5%\n     3  马剑          2.8%\n     2  TimZhang      1.8%\n     2  Ziyi Yan      1.8%\n     2  ken           1.8%\n     2  Lei           1.8%\n     2  pillarhou     1.8%\n     2  sunwf         1.8%\n     1  Jichao Wu     0.9%\n     1  HelloYou      0.9%\n     1  swfbarhr      0.9%\n     1  ladjzero      0.9%\n     1  三点          0.9%\n     1  mukaiu        0.9%\n\n```\n\n## 捐赠\n如果您觉得Wechat对您有帮助，欢迎请作者一杯咖啡\n\n![捐赠wechat](https://cloud.githubusercontent.com/assets/327019/2941591/2b9e5e58-d9a7-11e3-9e80-c25aba0a48a1.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-webot%2Fco-wechat-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-webot%2Fco-wechat-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-webot%2Fco-wechat-api/lists"}