mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 21:57:44 +00:00
feat: 挑战定时提醒
This commit is contained in:
parent
607b85c922
commit
534ef0765e
6 changed files with 340 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ import * as version from './version.js';
|
|||
|
||||
import * as device from './device.js';
|
||||
|
||||
import * as remind from './remind.js';
|
||||
|
||||
export default {
|
||||
assets,
|
||||
guides,
|
||||
|
|
@ -20,4 +22,5 @@ export default {
|
|||
panel,
|
||||
version,
|
||||
device,
|
||||
remind,
|
||||
};
|
||||
|
|
|
|||
29
apps/manage/remind.js
Normal file
29
apps/manage/remind.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import settings from '../../lib/settings.js';
|
||||
import { rulePrefix } from '../../lib/common.js';
|
||||
import ZZZPlugin from '../../lib/plugin.js';
|
||||
|
||||
export class RemindManage extends ZZZPlugin {
|
||||
constructor() {
|
||||
super({
|
||||
name: '[ZZZ-Plugin]RemindManage',
|
||||
dsc: '提醒功能管理',
|
||||
event: 'message',
|
||||
priority: 40, // 管理插件优先级较高
|
||||
rule: [
|
||||
{
|
||||
reg: `${rulePrefix}设置提醒时间\\s*(.+)`,
|
||||
fnc: 'setCron',
|
||||
permission: 'master',
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
async setCron() {
|
||||
const match = this.e.msg.match(/设置提醒时间\s*(.+)/);
|
||||
if (!match) return;
|
||||
const cron = match.trim();
|
||||
settings.setSingleConfig('remind', 'cron', cron);
|
||||
await this.reply(`式舆防卫战/危局强袭战提醒的定时任务已更新为: ${cron}`);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue