refactor: 在 CheckNewRss 函数中添加日志记录功能,以便更好地跟踪 RSS 更新过程,增强调试能力

This commit is contained in:
lixiangwuxian 2025-07-17 15:07:27 +08:00
parent 9a02a39638
commit 5a85a8376f

View File

@ -2,6 +2,7 @@ package rss
import (
"fmt"
"log"
"time"
"git.lxtend.com/lixiangwuxian/qqbot/action"
@ -46,12 +47,14 @@ func CheckNewRss() {
if feed.ID == 0 {
continue
}
log.Println("groupID:", group.GroupID, "feed.FeedURL:", feed.FeedURL)
//获取最新的rss数据
title, items, err := ParseFeed(feed.FeedURL)
if err != nil {
continue
}
//比较最新的rss数据与订阅信息中的last_item_hash若有更新则向对应群发送消息并更新订阅信息中的last_item_hash
log.Println("localHash:", group.LastItemHash, "remoteHash:", items[0].Hash)
if items[0].Hash != group.LastItemHash {
action.ActionManager.SendMsg(&model.Reply{
FromMsg: model.Message{