| } | } | ||||
| func echoInto(ss *openIDSessionData) { | func echoInto(ss *openIDSessionData) { | ||||
| kfSendTxt(ss.OpenID, "10 分钟没有输入之后 Echo将自动结束,\n输入 [结束Echo] 清除Echo模式") | |||||
| kfSendTxt(ss.OpenID, "10分钟静默之后 Echo将自动结束,\n输入 [结束Echo],或者语音 ‘退出退出', 清除Echo模式") | |||||
| } | } | ||||
| func echoCommand(ss *openIDSessionData, in InWechatMsg) { | func echoCommand(ss *openIDSessionData, in InWechatMsg) { | ||||
| m := in.body.(TextMsg) | m := in.body.(TextMsg) | ||||
| str, err = BuildTextMsg(openID, m.Content+"\n\n关键词 [转接] 将后续信息都转接到 客服 测试版") | str, err = BuildTextMsg(openID, m.Content+"\n\n关键词 [转接] 将后续信息都转接到 客服 测试版") | ||||
| msg := ss.getVal("msg") | msg := ss.getVal("msg") | ||||
| msg = msg + m.Content | |||||
| msg = msg + m.Content + "\n" | |||||
| ss.setKvPair("msg", msg) | ss.setKvPair("msg", msg) | ||||
| in.replyXML(str) | in.replyXML(str) | ||||
| case PicMsg: | case PicMsg: | ||||
| m := in.body.(VoiceMsg) | m := in.body.(VoiceMsg) | ||||
| str = buildVoiceMsg(openID, m.MediaId) | str = buildVoiceMsg(openID, m.MediaId) | ||||
| in.replyXML(str) | in.replyXML(str) | ||||
| msg := ss.getVal("msg") | |||||
| msg = msg + m.Recognition + "\n" | |||||
| ss.setKvPair("msg", msg) | |||||
| kfSendTxt(openID, "翻译结果:"+m.Recognition) | kfSendTxt(openID, "翻译结果:"+m.Recognition) | ||||
| case VideoMsg: | case VideoMsg: | ||||
| m := in.body.(VideoMsg) | m := in.body.(VideoMsg) | ||||
| case LocationMsg: | case LocationMsg: | ||||
| m := in.body.(LocationMsg) | m := in.body.(LocationMsg) | ||||
| mid := location2MediaID(m.Location_X, m.Location_Y) | mid := location2MediaID(m.Location_X, m.Location_Y) | ||||
| str, _ = BuildTextMsg(openID, fmt.Sprintf("long=%f, lat=%f, scale=%d", m.Location_X, m.Location_Y, m.Scale)) | |||||
| in.replyXML(str) | |||||
| str = buildPicMsg(openID, mid) | str = buildPicMsg(openID, mid) | ||||
| in.replyXML(str) | |||||
| url := location2URL(m.Location_X, m.Location_Y) | url := location2URL(m.Location_X, m.Location_Y) | ||||
| kfSendTxt(openID, url) | |||||
| kfSendTxt(openID, url+"\n"+fmt.Sprintf("long=%f, lat=%f, scale=%d", m.Location_X, m.Location_Y, m.Scale)) | |||||
| case LinkMsg: | case LinkMsg: | ||||
| m := in.body.(LinkMsg) | m := in.body.(LinkMsg) | ||||
| str, _ = BuildTextMsg(openID, m.Url) | str, _ = BuildTextMsg(openID, m.Url) |