示例#1
0
func msgHandleLink(answer chan []byte, msg *weixin.MessageReceiveLink) {
	from := msg.ToUserName
	to := msg.FromUserName

	a := weixin.MessageCreateText(from, to, "讨厌啦,人家还没学会呢~")
	x, _ := xml.Marshal(a)
	answer <- x
	return
}
示例#2
0
func msgHandleText(answer chan []byte, msg *weixin.MessageReceiveText) {
	from := msg.ToUserName
	to := msg.FromUserName

	a := weixin.MessageCreateText(from, to, "Hello 世界")

	x, _ := xml.Marshal(a)

	fmt.Printf("%s\n", string(x))
	answer <- x
	return
}