koishi-plugin-booknews 0.0.7 → 0.0.8

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.
Files changed (2) hide show
  1. package/lib/index.js +3 -9
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -43,12 +43,6 @@ function apply(ctx, config) {
43
43
  timestamp: "timestamp"
44
44
  }, { autoInc: true });
45
45
  const sendDailyReport = /* @__PURE__ */ __name(async (isManual = false) => {
46
- ctx.logger("booknews").error(
47
- "sendDailyReport called, newsList length =",
48
- (await ctx.database.get("daily_book_news", {})).length,
49
- "time =",
50
- Date.now()
51
- );
52
46
  const newsList = await ctx.database.get("daily_book_news", {});
53
47
  if (newsList.length === 0) return "今日暂无书讯。";
54
48
  const bot = ctx.bots[0];
@@ -62,7 +56,7 @@ function apply(ctx, config) {
62
56
  forward: true,
63
57
  userId: bot.selfId,
64
58
  nickname: item.authorName
65
- }, pureText);
59
+ }, import_koishi.h.parse(pureText));
66
60
  });
67
61
  const partNum = Math.floor(i / chunkSize) + 1;
68
62
  const totalParts = Math.ceil(newsList.length / chunkSize);
@@ -92,11 +86,11 @@ function apply(ctx, config) {
92
86
  authorName: session.username || session.userId,
93
87
  timestamp: /* @__PURE__ */ new Date()
94
88
  });
95
- session.send("已收录书讯");
96
89
  });
97
90
  ctx.cron(config.sendTime, () => sendDailyReport(false));
98
91
  ctx.command("sendnews", "手动触发发送今日书讯").option("clear", "-c 发送后清空数据库", { fallback: false }).action(async ({ options }) => {
99
- return await sendDailyReport(!options.clear);
92
+ await sendDailyReport(!options.clear);
93
+ ctx.logger("book").info(`日报发送成功`);
100
94
  });
101
95
  }
102
96
  __name(apply, "apply");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-booknews",
3
3
  "description": "It's a plugin for booknews collection",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [