func ClickHandler(w weixin.ResponseWriter, r *weixin.Request) { switch r.EventKey { case "MENU_KEY_CONTACT": w.ReplyText("联系人: 陆宗宝, 17092500181, weixin: 41552136\n本后台使用GO语言开发") default: for i, t := range menu_keys { if t == r.EventKey { w.ReplyText(menu_cvs[i]) return } } w.ReplyText("你点击了菜单:\n\t" + r.EventKey + "\n此功能正在建设中...") } }
func Echo(w weixin.ResponseWriter, r *weixin.Request) { txt := r.Content // 获取用户发送的消息 w.ReplyText(txt) // 回复一条文本消息 //w.PostText("Post:" + txt) // 发送一条文本消息 MenuHandler(r.Content, w.GetWeixin()) }