最近重新启用了 Koishi(解除了QQ账户风控)机器人。除原有功能外,我计划新增一个功能:博客更新时,QQ 机器人能将更新推送到 QQ 群。

我使用的机器人框架Koishi有个叫 “[koishi-plugin-rss-owl]” 的插件,可订阅 RSS 源,而我的博客能生成 RSS 源。完成配置后,推送功能正常运行。

我对推送卡片的 HTML 模板进行了修改,代码如下:

<body style="width: 100%; padding: 20px; background: #f0f4f8; font-family: Arial, sans-serif; margin: 0; display: flex; justify-content: center; align-items: center;">
  <div style="width: 1920px; height: auto; background: white; border-radius: 20px; box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1); overflow: hidden; padding: 40px; display: flex; flex-direction: column;">
    
    <!-- 频道信息卡片 -->
    <div style="background: linear-gradient(to bottom right, #0066cc, #00cc99); display: flex; flex-direction: column; align-items: center; border-radius: 10px; padding: 60px; margin-bottom: 40px; backdrop-filter: blur(5px) brightness(0.8);">
      <div style="font-size: 80px; font-weight: bold; color: white; text-align: center; margin-bottom: 30px;">{{rss.channel.title}}</div>
      <p style="color: white; font-size: 32px; text-align: center; margin-bottom: 30px;">{{rss.channel.description}}</p>
      <p style="color: white; font-size: 24px; text-align: center; margin-bottom: 30px;">砂纸AI RSS自动订阅更新</p>
    </div>
    
    <!-- 文章内容卡片 -->
    <div style="background: #f7f7f7; border-radius: 12px; box-shadow: 0px 4px 12px rgba(0,0,0,0.1); padding: 60px;">
      <div style="font-size: 80px; font-weight: bold; margin-bottom: 30px; color: #333;">{{title}}</div>
      <div style="font-size: 32px; color: #777; display: flex; justify-content: space-between; margin-bottom: 30px;">
        <div style="font-size:28px;color:#0066cc;margin-bottom:12px;">🕒 {{pubDate|'未知时间'}} | 🧾 {{category|'无类别'}}</div>
      </div>
      <div style="font-size: 42px; margin-bottom: 30px; color: #333;">{{description}}</div>
      <div style="font-size: 30px; color: #555; margin-top: 20px;">链接: <a href="{{link}}" style="color: #0066cc;" target="_blank">{{link}}</a></div>
    </div>
  </div>
</body>

custom模板的文字补充如下:

🌟RSS订阅更新🌟
{{description}}
文章链接👉{{link}}

此外,我为我一个做视频的朋友实现了哔哩哔哩更新推送和直播提醒到粉丝群的功能。用到的插件是 “[bilibili-notify]”,效果如图: