From 98a5e2d45543f89e052b40248facd3911e7891d9 Mon Sep 17 00:00:00 2001 From: Patrick Peng Sun Date: Sun, 28 May 2017 03:46:45 +1000 Subject: [PATCH] sample kf event --- sample_data/kf_event.txt | 17 +++++++++++++++++ serveCommand.go | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 sample_data/kf_event.txt diff --git a/sample_data/kf_event.txt b/sample_data/kf_event.txt new file mode 100644 index 0000000..420026b --- /dev/null +++ b/sample_data/kf_event.txt @@ -0,0 +1,17 @@ + + +1495907032 + + + + + + + + +1495907067 + + + + + \ No newline at end of file diff --git a/serveCommand.go b/serveCommand.go index f8df67c..c7fac03 100644 --- a/serveCommand.go +++ b/serveCommand.go @@ -19,6 +19,7 @@ func echoCommand(openID string, in InWechatMsg) (state chatState, processed bool case TextMsg: m := in.body.(TextMsg) str, err = BuildTextMsg(openID, m.Content) + processed = false case PicMsg: m := in.body.(PicMsg) str = buildPicMsg(openID, m.MediaId) @@ -37,9 +38,8 @@ func echoCommand(openID string, in InWechatMsg) (state chatState, processed bool 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)) - // str = buildPicMsg(openID, mid) + str = buildPicMsg(openID, mid) url := location2URL(m.Location_X, m.Location_Y) - str, _ = BuildTextMsg(openID, mid+"\r\n"+url) kfSendTxt(openID, url) case LinkMsg: