1.1.0 • Published 10 years ago

li-wechat v1.1.0

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

微信公众平台基础接口

NPM version Build Status Coverage Status Status NPM

  • 微信公众平台基础接口
  • 高级API coming soon!

Getting Started

Install the module with: npm install li-wechat --save

var wechat = require('li-wechat')('TOKEN');

Documentation

###接收的消息类型

  • text 文本消息
  • image 图片消息
  • voice 语音消息
  • video 视频消息
  • location 地理位置消息
  • link 链接消息
   wechat.on('text',function(session){
        //TODO
   });

###接收事件类型

  • event.subscribe 关注关注事件
  • event.unsubscribe 取消关注事件
  • event.SCAN 扫描带参数二维码事件,用户已关注时的事件推送
  • event.LOCATION 上报地理位置事件
  • event.CLICK 点击菜单拉取消息时的事件推送
  • event.VIEW 点击菜单跳转链接时的事件推送
   wechat.on('event.subscribe',function(session){
        //TODO
   });

###调试消息

  • 使用namespace为wechat的debug ####开启消息调试方式
    DEBUG=wechat node index.js

Examples

   var express = require('express');
   var wechat = require('li-wechat')('yali');

   var app = express();

   wechat.on('text', function (session) {
       session.replyTextMessage("Received:" + session.incomingMessage.Content);
   });

   app.use('/api',  wechat.process());

   app.listen(80);

Contributing

License

Copyright (c) 2014 liangyali
Licensed under the MIT license.

1.1.0

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago