From 9a02a396388f473f70fd691e34e444fd35325a17 Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Thu, 17 Jul 2025 15:00:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20Subscribe=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E4=BB=A5=E6=94=B6=E9=9B=86=E5=B9=B6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=20RSS=20=E8=AE=A2=E9=98=85=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=A2=9E=E5=BC=BA=E7=94=A8=E6=88=B7=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E7=9A=84=E5=87=86=E7=A1=AE=E6=80=A7=E5=92=8C=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/rss/rss.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/handler/rss/rss.go b/handler/rss/rss.go index 0fcef7d..62a001a 100644 --- a/handler/rss/rss.go +++ b/handler/rss/rss.go @@ -33,6 +33,7 @@ func TestRss(msg model.Message) (reply *model.Reply) { func Subscribe(msg model.Message) (reply *model.Reply) { //提取url var subscribedFeeds []string + var errs []string for _, data := range msg.StructuredMsg { if data.GetMessageType() == "text" { // 匹配RSS链接:可选协议,域名(包含所有顶级域),路径,不一定以.xml结尾 @@ -41,6 +42,8 @@ func Subscribe(msg model.Message) (reply *model.Reply) { for _, url := range urls { if title, err := SubscribeToFeed(url, msg.UserId, msg.GroupInfo.GroupId); err == nil { subscribedFeeds = append(subscribedFeeds, title) + } else { + errs = append(errs, err.Error()) } } } @@ -56,7 +59,7 @@ func Subscribe(msg model.Message) (reply *model.Reply) { } return &model.Reply{ - ReplyMsg: "未找到有效的RSS链接(需要以.xml结尾)", + ReplyMsg: "未找到有效的RSS链接,相关错误信息:\n" + strings.Join(errs, "\n"), ReferOriginMsg: true, FromMsg: msg, }