From 94beb84d6d8e31f869ce9bb15a042c26ecc7e6cc Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Fri, 8 Aug 2025 18:16:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=90=8C=E4=B8=80=E4=B8=AArss=205min=20?= =?UTF-8?q?=E5=86=85=E7=9A=84=E5=A4=9A=E4=B8=AA=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/rss/job.go | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/handler/rss/job.go b/handler/rss/job.go index b626a81..4513349 100644 --- a/handler/rss/job.go +++ b/handler/rss/job.go @@ -60,24 +60,28 @@ func CheckNewRss() { } //比较最新的rss数据与订阅信息中的last_item_hash,若有更新则向对应群发送消息,并更新订阅信息中的last_item_hash log.Println("localHash:", group.LastItemHash, "remoteHash:", items[0].Hash) - if items[0].Hash != group.LastItemHash { - db.Model(&group).Update("last_item_hash", items[0].Hash) - action.ActionManager.SendMsg(&model.Reply{ - FromMsg: model.Message{ - GroupInfo: model.GroupInfo{ - GroupId: int64(group.GroupID), - IsGroupMsg: true, - }, - }, - ReplyMsg: []qq_message.QQMessage{ - &qq_message.TextMessage{ - Type: qq_message.TypeText, - Data: qq_message.TextMessageData{ - Text: fmt.Sprintf("您订阅的%s发布了新的文章: %s\n%s", title, items[0].Title, items[0].Link), + db.Model(&group).Update("last_item_hash", items[0].Hash) + for _, item := range items { + if item.Hash != group.LastItemHash { + action.ActionManager.SendMsg(&model.Reply{ + FromMsg: model.Message{ + GroupInfo: model.GroupInfo{ + GroupId: int64(group.GroupID), + IsGroupMsg: true, }, }, - }, - }) + ReplyMsg: []qq_message.QQMessage{ + &qq_message.TextMessage{ + Type: qq_message.TypeText, + Data: qq_message.TextMessageData{ + Text: fmt.Sprintf("您订阅的%s发布了新的文章: %s\n%s", title, items[0].Title, items[0].Link), + }, + }, + }, + }) + } else { + break + } } } }