From f47ed3226e6ccef59e16473bd54b338977fc89eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B5=B7?= Date: Tue, 19 Mar 2024 08:32:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wclient/README.md | 7 +++++++ wclient/client.go | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wclient/README.md b/wclient/README.md index 119c01b..0ded040 100644 --- a/wclient/README.md +++ b/wclient/README.md @@ -155,6 +155,13 @@ type ApiCallbackData struct { } ``` +```json +{ + "type": "image", + "link": "图片链接" +} +``` + ```json { "type": "text", diff --git a/wclient/client.go b/wclient/client.go index 9f5480c..6e7bf77 100644 --- a/wclient/client.go +++ b/wclient/client.go @@ -122,6 +122,7 @@ func ApiRequestMsg(url, wxid, roomid string) int32 { "User-Agent": args.AppName + "/" + args.Version, "Client-Uid": self.Wxid + "," + wxid, }) + if err != nil { if res == "" { res = err.Error() @@ -179,7 +180,7 @@ type ApiResponse struct { Link string `json:"link"` // 点击后跳转的链接 Icon string `json:"icon"` // 右侧缩略图的链接,可选 } `json:"card,omitempty"` - Link string `json:"file,omitempty"` // 当 type 为 file 或 image 时有效 + Link string `json:"link,omitempty"` // 当 type 为 file 或 image 时有效 Text string `json:"text,omitempty"` // 当 type 为 text 或 error 时有效 }