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 }
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 }