From 10795ab6b3e2bd6ed19931ba6ec1e7e06ebb6dcb Mon Sep 17 00:00:00 2001 From: Patrick Peng Sun Date: Thu, 1 Jun 2017 01:07:33 +1000 Subject: [PATCH] introduce helper function --- wechatMsg.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wechatMsg.go b/wechatMsg.go index 789160e..4ff73a3 100644 --- a/wechatMsg.go +++ b/wechatMsg.go @@ -19,6 +19,11 @@ func (m *InWechatMsg) destroy() { close(m.instantResponse) } -func (m *InWechatMsg) immediateResponse(s string) { - m.instantResponse <- s +func (m *InWechatMsg) replyXML(xml string) { + m.instantResponse <- xml +} + +func (m *InWechatMsg) replyText(s string) { + str, _ := BuildTextMsg(m.header.FromUserName, s) + m.instantResponse <- str }