diff --git a/procEcho.go b/procEcho.go index 2420d56..546b6c1 100644 --- a/procEcho.go +++ b/procEcho.go @@ -63,7 +63,7 @@ func echoSummary(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) { @@ -75,7 +75,7 @@ func echoCommand(ss *openIDSessionData, in InWechatMsg) { m := in.body.(TextMsg) str, err = BuildTextMsg(openID, m.Content+"\n\n关键词 [转接] 将后续信息都转接到 客服 测试版") msg := ss.getVal("msg") - msg = msg + m.Content + msg = msg + m.Content + "\n" ss.setKvPair("msg", msg) in.replyXML(str) case PicMsg: @@ -86,6 +86,9 @@ func echoCommand(ss *openIDSessionData, in InWechatMsg) { m := in.body.(VoiceMsg) str = buildVoiceMsg(openID, m.MediaId) in.replyXML(str) + msg := ss.getVal("msg") + msg = msg + m.Recognition + "\n" + ss.setKvPair("msg", msg) kfSendTxt(openID, "翻译结果:"+m.Recognition) case VideoMsg: m := in.body.(VideoMsg) @@ -98,11 +101,10 @@ func echoCommand(ss *openIDSessionData, in InWechatMsg) { case LocationMsg: m := in.body.(LocationMsg) 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) + in.replyXML(str) 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: m := in.body.(LinkMsg) str, _ = BuildTextMsg(openID, m.Url)