Skip to content

Commit cd3dbb4

Browse files
committed
fix textcard type add btntxt parameter
1 parent ce6aaac commit cd3dbb4

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

context.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ func (c *Context) NewVideo(mediaId, title, desc string) *Context {
105105
}
106106

107107
// NewTextcard Textcard消息
108-
func (c *Context) NewTextcard(title, description, url string) *Context {
108+
func (c *Context) NewTextcard(title, description, url, btntxt string) *Context {
109109
c.Resp = &Textcard{
110110
wxResp: c.newResp(TypeTextcard),
111-
Textcard: textcard{CDATA(title), CDATA(description), CDATA(url)}}
111+
Textcard: textcard{CDATA(title), CDATA(description), CDATA(url), CDATA(btntxt)}}
112112
return c
113113
}
114114

send.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func (s *Server) SendVideo(to string, mediaId, title, desc string) *WxErr {
6565
}
6666

6767
// SendTextcard 发送客服extcard消息
68-
func (s *Server) SendTextcard(to string, title, desc, url string) *WxErr {
69-
return s.SendMsg(s.NewTextcard(to, title, desc, url))
68+
func (s *Server) SendTextcard(to string, title, desc, url, btntxt string) *WxErr {
69+
return s.SendMsg(s.NewTextcard(to, title, desc, url, btntxt))
7070
}
7171

7272
// SendMusic 发送客服Music消息

type.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,15 @@ type (
179179
Title CDATA `json:"title"`
180180
Description CDATA `json:"description"`
181181
Url CDATA `json:"url"`
182+
Btn CDATA `json:"btntxt"`
182183
}
183184
)
184185

185186
// NewTextcard Textcard消息
186-
func (s *Server) NewTextcard(to, title, description, url string) Textcard {
187+
func (s *Server) NewTextcard(to, title, description, url, btntxt string) Textcard {
187188
return Textcard{
188189
s.newWxResp(TypeTextcard, to),
189-
textcard{CDATA(title), CDATA(description), CDATA(url)},
190+
textcard{CDATA(title), CDATA(description), CDATA(url), CDATA(btntxt)},
190191
}
191192
}
192193

0 commit comments

Comments
 (0)