源码地址:
https://github.com/MwlLj/go-wechat
安装:
go get github.com/MwlLj/go-wechat
使用时只需要包含两个包
import (
"github.com/MwlLj/go-wechat"
"github.com/MwlLj/go-wechat/common"
)
可以很简单的实现收发
package main
import (
"fmt"
"github.com/MwlLj/go-wechat"
"github.com/MwlLj/go-wechat/common"
)
var _ = fmt.Println
func main() {
info := common.CUserInfo{
AppId: "your appid",
AppSecret: "your appsecret",
Port: 80,
Url: "/xxx",
Token: "your token",
}
wc := wechat.New(&info)
wc.RegisterMsgFunc(func(reply common.IReply, msg *common.CMessage, u