koishi-plugin-ll-schedule 1.7.11 → 1.7.13

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 +6 -1
  2. package/package.json +3 -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
  }
@@ -1210,7 +1215,7 @@ function apply(ctx, config) {
1210
1215
  ctx.command('取消剑灵订阅', '取消本群的全部剑灵提醒')
1211
1216
  .action(async ({ session }) => {
1212
1217
  if (!(await checkSubscribePerm(session))) return permDeniedHint()
1213
- return await unsubscribeCurrentGroup(session, taskName)
1218
+ return await unsubscribeCurrentGroup(session)
1214
1219
  })
1215
1220
 
1216
1221
  ctx.command('订阅列表', '查看订阅了提醒的群')
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.13",
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,5 @@
21
21
 
22
22
 
23
23
 
24
+
25
+