diff --git "a/apps/\347\273\255\347\201\253.js" "b/apps/\347\273\255\347\201\253.js" new file mode 100644 index 0000000..4722afc --- /dev/null +++ "b/apps/\347\273\255\347\201\253.js" @@ -0,0 +1,12 @@ +import { karin } from 'node-karin' +import { Config } from '#components' + +export const 续火 = karin.task("续火", Config.Cof.corn || "0 0 * * *", async () => { + for (const id of Config.Cof.List || '') { + try { + const elements = [segment.text(Config.Cof.msg)] + const contact = karin.contactFriend(id) + await e.bot.SendMessage(contact, elements) + } catch (error) { } + } +}, { name: "续火" }) \ No newline at end of file diff --git a/components/Config.js b/components/Config.js index b5a37ee..0e11527 100644 --- a/components/Config.js +++ b/components/Config.js @@ -44,6 +44,10 @@ class Config { return this.getDefOrConfig('other') } + get Cof () { + return this.getDefOrConfig('COF') + } + get state () { return this.getDefOrConfig('state') } diff --git a/config/default_config/COF.yaml b/config/default_config/COF.yaml new file mode 100644 index 0000000..cc95a3e --- /dev/null +++ b/config/default_config/COF.yaml @@ -0,0 +1,3 @@ +cron: "0 0 * * *" # cron表达式 +msg: "续火" # 回复文本 +List: [] # 续火对象列表 \ No newline at end of file