forked from silenceper/wechat
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdoc.go
More file actions
33 lines (24 loc) · 750 Bytes
/
doc.go
File metadata and controls
33 lines (24 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
Package wechat provide 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()
更多信息:https://github.com/TargetLiu/wechat
*/
package wechat