koishi-plugin-ll-schedule 1.2.0 → 1.3.1

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 +10 -18
  2. package/package.json +3 -1
package/index.js CHANGED
@@ -48,7 +48,7 @@ exports.usage = `定时提醒插件:到时间自动向订阅了该任务的群
48
48
 
49
49
  ## Markdown 卡片(官方QQ机器人)
50
50
 
51
- 任务勾选 \`markdown\` 后,会用 QQ 官方 Markdown 卡片发送(仅官机生效,失败自动回退纯文本;其他平台始终纯文本)。内容里可用标题/加粗/引用/链接/图片,模板变量自动替换。任务填 \`image\` 图片 URL 也会随消息发出(markdown 模式自动嵌入)。
51
+ 任务勾选 \`markdown\` 后,会用 QQ 官方 Markdown 卡片发送(仅官机生效,失败自动回退纯文本;其他平台始终纯文本)。内容里可用标题/加粗/引用/链接/图片(图片直接写在内容里,如 \`![配图](https://...)\`),模板变量自动替换。
52
52
 
53
53
  ## 其他配置
54
54
 
@@ -214,8 +214,9 @@ const SlotItem = Schema.object({
214
214
  .required()
215
215
  .description('时间(24小时制 HH:MM),可多个用逗号分隔,如 12:20, 18:20, 21:20'),
216
216
  text: Schema.string()
217
+ .role('textarea', { rows: [3, 10] })
217
218
  .default('')
218
- .description('内容:到点发送的话,支持 Markdown 和模板变量 {date} {time} {week} {task}'),
219
+ .description('内容:到点发送的话,支持 Markdown 和模板变量 {date} {time} {week} {task}(大多行文本框,可多行写卡片)'),
219
220
  })
220
221
 
221
222
  const TaskItem = Schema.object({
@@ -228,9 +229,6 @@ const TaskItem = Schema.object({
228
229
  markdown: Schema.boolean()
229
230
  .default(false)
230
231
  .description('用 QQ官方 Markdown 卡片发送(仅官方QQ机器人生效,失败自动回退纯文本;其他平台始终纯文本)'),
231
- image: Schema.string()
232
- .default('')
233
- .description('图片 URL(可选):随内容一起发送(markdown 模式自动嵌入为图片)'),
234
232
  enabled: Schema.boolean()
235
233
  .default(true)
236
234
  .description('是否启用'),
@@ -240,12 +238,6 @@ const Config = Schema.object({
240
238
  tasks: Schema.dict(TaskItem)
241
239
  .default({})
242
240
  .description('📋 推送任务表格(键=任务名;每个任务 = 时间段列表:星期/时间/内容)'),
243
- subscribeKeyword: Schema.string()
244
- .default('订阅')
245
- .description('群内订阅推送的关键词(如"订阅 任务名",只输关键词则订阅唯一启用的任务)'),
246
- unsubscribeKeyword: Schema.string()
247
- .default('取消订阅')
248
- .description('群内取消订阅的关键词(如"取消订阅 任务名")'),
249
241
  subscribeAuthority: Schema.number()
250
242
  .min(1).max(4).default(1)
251
243
  .description('执行订阅命令所需的最低权限等级(Koishi 用户权限等级,与QQ群主/管理员身份无关;默认 1=所有人都能订阅。如需限制,先在控制台"用户管理"给指定账号提权,再调高此值)'),
@@ -604,8 +596,8 @@ function apply(ctx, config) {
604
596
  .action(() => {
605
597
  logger.info('[schedule] 命令被调用: schedule')
606
598
  return '⚙️ 管理:插件设置页 → ll-schedule → tasks 添加任务和时间段(星期/时间/内容)\n' +
607
- `群内发"${config.subscribeKeyword} 任务名"即可让本群订阅推送\n` +
608
- `命令:${config.subscribeKeyword} | ${config.unsubscribeKeyword} | 订阅列表 | schedule.list | schedule.groups | schedule.test <任务名>`
599
+ `群内发"订阅 任务名"即可让本群订阅推送\n` +
600
+ `命令:订阅 | 取消订阅 | 订阅列表 | schedule.list | schedule.groups | schedule.test <任务名>`
609
601
  })
610
602
 
611
603
  ctx.command('schedule.list', '查看定时任务')
@@ -709,7 +701,7 @@ function apply(ctx, config) {
709
701
  return `✅ 本群已取消订阅任务 "${name}"`
710
702
  }
711
703
 
712
- ctx.command(config.subscribeKeyword + ' [taskName:text]', '让当前群订阅指定任务的推送')
704
+ ctx.command('订阅 [taskName:text]', '让当前群订阅指定任务的推送')
713
705
  .action(async ({ session }, taskName) => {
714
706
  if (!(await checkSubscribePerm(session))) return permDeniedHint()
715
707
  return await subscribeCurrentGroup(session, taskName)
@@ -721,7 +713,7 @@ function apply(ctx, config) {
721
713
  return await subscribeCurrentGroup(session, taskName)
722
714
  })
723
715
 
724
- ctx.command(config.unsubscribeKeyword + ' [taskName:text]', '让当前群取消订阅指定任务的推送')
716
+ ctx.command('取消订阅 [taskName:text]', '让当前群取消订阅指定任务的推送')
725
717
  .action(async ({ session }, taskName) => {
726
718
  if (!(await checkSubscribePerm(session))) return permDeniedHint()
727
719
  return await unsubscribeCurrentGroup(session, taskName)
@@ -736,7 +728,7 @@ function apply(ctx, config) {
736
728
  ctx.command('订阅列表', '查看所有任务的订阅群')
737
729
  .action(async () => {
738
730
  logger.info('[schedule] 命令被调用: 订阅列表')
739
- if (!subs.size) return '暂无任何群订阅。群内发"' + config.subscribeKeyword + ' 任务名"即可订阅'
731
+ if (!subs.size) return '暂无任何群订阅。群内发"订阅 任务名"即可订阅'
740
732
  const lines = []
741
733
  for (const [taskName, taskSubs] of subs) {
742
734
  const entries = [...taskSubs.values()]
@@ -753,7 +745,7 @@ function apply(ctx, config) {
753
745
  ctx.command('lls.sublist', '查看订阅列表(备用入口)')
754
746
  .action(async () => {
755
747
  logger.info('[schedule] 命令被调用: lls.sublist')
756
- if (!subs.size) return '暂无任何群订阅。群内发"' + config.subscribeKeyword + ' 任务名"即可订阅'
748
+ if (!subs.size) return '暂无任何群订阅。群内发"订阅 任务名"即可订阅'
757
749
  const lines = []
758
750
  for (const [taskName, taskSubs] of subs) {
759
751
  const entries = [...taskSubs.values()]
@@ -828,7 +820,7 @@ function apply(ctx, config) {
828
820
  })
829
821
 
830
822
  logger.info('[schedule] 命令已注册: schedule / schedule.list / schedule.groups / schedule.test / ' +
831
- `"${config.subscribeKeyword}" / "${config.unsubscribeKeyword}" / 订阅列表 / lls.*`)
823
+ `"订阅" / "取消订阅" / 订阅列表 / lls.*`)
832
824
 
833
825
  Promise.all([loadKnownGroups(), loadSubs()]).then(() => checkAndSend())
834
826
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-ll-schedule",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "Scheduled message sender with weekly slots (per-day time & content), QQ official markdown card support",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -19,3 +19,5 @@
19
19
  }
20
20
  }
21
21
 
22
+
23
+