Browse Source

template message result

ls 4 years ago
parent
commit
bc15f10864
1 changed files with 12 additions and 0 deletions
  1. 12 0
      wechat/client.go

+ 12 - 0
wechat/client.go

@@ -1,6 +1,7 @@
 package wechat
 
 import (
+	"errors"
 	"fmt"
 	"net/url"
 	"time"
@@ -242,3 +243,14 @@ func (wc Client) SendTemplateMessage(template TemplateMessage) (jq *myth.JSONQue
 	}
 	return
 }
+
+// TemplateMessageReslut template message reslut
+func (wc Client) TemplateMessageReslut(jq *myth.JSONQuery) (code, id int, err error) {
+	code, _ = jq.Int(`errcode`)
+	errmsg, _ := jq.String(`errmsg`)
+	id, _ = jq.Int(`msgid`)
+	if code != ErrReqOk {
+		err = errors.New(errmsg)
+	}
+	return
+}