koishi-plugin-wordpress-notifier 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -265,6 +265,13 @@ npm install
265
265
 
266
266
  ## 版本历史
267
267
 
268
+ ### 2.0.2 (2026-01-25)
269
+
270
+ - 🐛 修复每次重载时重新推送的问题
271
+ - 🔧 优化推送去重机制,只使用群聊记录跟踪推送状态
272
+ - 🔧 确保每个群聊只会收到一次相同的文章推送
273
+ - 🔧 优化错误处理,确保插件核心功能正常工作
274
+
268
275
  ### 2.0.1 (2026-01-25)
269
276
 
270
277
  - 📝 更新文档,完善新功能说明
package/lib/index.js CHANGED
@@ -78,6 +78,8 @@ function apply(ctx, config) {
78
78
  }
79
79
  catch (error) {
80
80
  ctx.logger.error(`获取 WordPress 用户失败: ${error}`);
81
+ ctx.logger.error(`WordPress REST API 的 users 端点可能需要认证才能访问,当前版本暂不支持认证配置`);
82
+ // 返回空数组,确保插件继续运行
81
83
  return [];
82
84
  }
83
85
  }
@@ -94,10 +96,6 @@ function apply(ctx, config) {
94
96
  return [];
95
97
  }
96
98
  }
97
- async function isPostPushed(postId) {
98
- const record = await ctx.database.get('wordpress_posts', { postId });
99
- return record.length > 0;
100
- }
101
99
  async function isUserPushed(userId) {
102
100
  const record = await ctx.database.get('wordpress_user_registrations', { userId });
103
101
  return record.length > 0;
@@ -110,12 +108,6 @@ function apply(ctx, config) {
110
108
  const record = await ctx.database.get('wordpress_group_pushes', { groupId, postId });
111
109
  return record.length > 0;
112
110
  }
113
- async function markPostAsPushed(postId) {
114
- await ctx.database.create('wordpress_posts', {
115
- postId,
116
- pushedAt: new Date()
117
- });
118
- }
119
111
  async function markUserAsPushed(userId) {
120
112
  await ctx.database.create('wordpress_user_registrations', {
121
113
  userId,
@@ -243,10 +235,6 @@ function apply(ctx, config) {
243
235
  ctx.logger.error(`错误详情: ${JSON.stringify(error)}`);
244
236
  }
245
237
  }
246
- // 标记文章已推送(全局记录)
247
- if (!(await isPostPushed(post.id))) {
248
- await markPostAsPushed(post.id);
249
- }
250
238
  }
251
239
  }
252
240
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-wordpress-notifier",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "WordPress 文章自动推送到 QQ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",