koishi-plugin-ll-schedule 1.7.11 → 1.7.12

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/index.js +5 -0
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -855,6 +855,11 @@ function apply(ctx, config) {
855
855
  async function sendReminder(inst, next, now, hm) {
856
856
  const text = renderRemindTemplate(resolveRemindTemplate(config.remindTemplate), makeRemindVars(inst, next, now, hm))
857
857
  if (!text) return
858
+ // 防串内容:渲染出来的内容必须包含该活动的名字,否则拒发并报警
859
+ if (!text.includes(inst.activity)) {
860
+ logger.error(`[schedule] 渲染内容与活动不匹配(应为「${inst.activity}」),已拒发|首行:${String(text).split('\n')[0]}`)
861
+ return
862
+ }
858
863
  logger.info(`[schedule] 活动提醒「${inst.activity}」开始于 ${inst.start}(提前 ${inst.advance} 分钟)`)
859
864
  await sendToSubscribers(text, { markdown: !!config.remindMarkdown })
860
865
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-ll-schedule",
3
- "version": "1.7.11",
3
+ "version": "1.7.12",
4
4
  "description": "BNS activity reminder: one activity table, one-click subscribe, auto reminders with time/place/next-up, QQ official markdown card support",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -21,3 +21,4 @@
21
21
 
22
22
 
23
23
 
24
+