WeChat SDK for Go (微信SDK:简单、易用)

wenzl 2bb40a640e 获取公众号菜单配置 hace 10 años
cache 4333691b37 oauth2,jssdk hace 10 años
context 4333691b37 oauth2,jssdk hace 10 años
js 4333691b37 oauth2,jssdk hace 10 años
material 4333691b37 oauth2,jssdk hace 10 años
menu 2bb40a640e 获取公众号菜单配置 hace 10 años
message 4a1470dcda 增加自定义菜单api hace 10 años
oauth 4333691b37 oauth2,jssdk hace 10 años
server d9cda28d3f remove strings.Compare hace 10 años
util 4333691b37 oauth2,jssdk hace 10 años
.gitignore f3303e2bb3 Initial commit hace 10 años
.travis.yml dae68ddc3e update travis hace 10 años
LICENSE f3303e2bb3 Initial commit hace 10 años
README.md da621bd050 Update README.md hace 10 años
wechat.go 4a1470dcda 增加自定义菜单api hace 10 años

README.md

WeChat SDK for Go

使用Golang开发的微信SDK,简单、易用。

快速开始

以下是一个处理消息接收以及回复的例子:


	//配置微信参数
	config := &wechat.Config{
		AppID:          "xxxx",
		AppSecret:      "xxxx",
		Token:          "xxxx",
		EncodingAESKey: "xxxx",
	}
	wc := wechat.NewWechat(config)

	// 传入request和responseWriter 
	server := wc.GetServer(request, responseWriter)
	server.SetMessageHandler(func(msg message.MixMessage) *message.Reply {

		//回复消息:演示回复用户发送的消息
		text := message.NewText(msg.Content)
		return &message.Reply{message.MsgText, text}
	})

	server.Serve()
	server.Send()

更多API使用

文档地址

已实现的微信平台接口

  • 消息管理(事件推送)
  • 网页授权Oauth2 ,Js-SDK
  • 菜单管理
  • 用户管理
  • 素材管理

持续完善中...

License

Apache License, Version 2.0