koishi-schedule-send
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

koishi-schedule-send

编写自动发送消息的 Koishi 插件框架。

编写插件

export class Config {
  @SchemaProperty()
  message: string;
}

// 在这里不用写任何东西
@DefinePlugin()
export default class TestSendPlugin extends SchedulePlugin(Config) {
  async send() {
    return this.config.message;
  }
}

配置

配置会自动从插件工厂函数中混入,下面为配置。其中 targetskoishi-target-def 的定义。

间隔定义有 cron interval randomInterval 三种,可以自由组合使用。

cron: '18 13 * * * *' # cron 语法
interval: 30000 # 固定间隔
randomInterval: # 随机间隔
  min: 5000
  max: 10000
immediate: false # 是否立即发送
targets:
  - bot: 'onebot:1111111111'
    channels:
      - channelId: '222222222'

Package Sidebar

Install

npm i koishi-schedule-send

Weekly Downloads

33

Version

2.1.2

License

MIT

Unpacked Size

19.7 kB

Total Files

8

Last publish

Collaborators

  • nanahira