Commit 352a038f authored by nanahira's avatar nanahira

migrate to reusable

parent d6fd231a
......@@ -21,18 +21,18 @@ npm install koishi-plugin-spammer
```yaml
# koishi.yaml
plugins:
autopic:
instances:
- paths: # 文件路径,一行一个。
- ./data.txt
presets: # 预设的消息。paths 和 presets 选择一个即可。
- Hello!
# 下列配置详见 koishi-schedule-send
cron: '18 13 * * * *'
interval: 30000
immediate: false
targets:
- bot: 'onebot:1111111111'
channels:
- channelId: '222222222'
spammer@foo:
paths: # 文件路径,一行一个。
- ./data.txt
presets: # 预设的消息。paths 和 presets 选择一个即可。
- Hello!
# 下列配置详见 koishi-schedule-send
cron: '18 13 * * * *'
interval: 30000
targets:
- bot: 'onebot:1111111111'
users:
- '33333333'
channels:
- channelId: '222222222'
```
// import 'source-map-support/register';
import { SpammerConfig } from './config';
import { DefinePlugin, MultiInstancePlugin } from 'koishi-thirdeye';
import { DefinePlugin, Reusable } from 'koishi-thirdeye';
import { SchedulePlugin } from 'koishi-schedule-send';
export * from './config';
@Reusable()
@DefinePlugin()
export class Spammer extends SchedulePlugin(SpammerConfig) {
export default class Spammer extends SchedulePlugin(SpammerConfig) {
async send() {
return this.config.getText();
}
}
@DefinePlugin()
export default class SpammerPlugin extends MultiInstancePlugin(Spammer) {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment