mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 05:37:46 +00:00
fix: 修复全局时间配置和获取
This commit is contained in:
parent
40bfbda264
commit
22711ee7b1
2 changed files with 5 additions and 3 deletions
|
|
@ -10,7 +10,8 @@ export async function setGlobalRemind() {
|
||||||
if (!match) return;
|
if (!match) return;
|
||||||
const remindTime = match[1];
|
const remindTime = match[1];
|
||||||
|
|
||||||
// 将全局提醒时间写入yaml配置
|
// 使用 setSingleConfig 更新特定字段
|
||||||
settings.setConfig('remind.globalRemindTime', remindTime);
|
settings.setSingleConfig('remind', 'globalRemindTime', remindTime);
|
||||||
|
|
||||||
await this.reply(`全局提醒时间已更新为: ${remindTime}。`);
|
await this.reply(`全局提醒时间已更新为: ${remindTime}。`);
|
||||||
}
|
}
|
||||||
|
|
@ -301,7 +301,8 @@ export class Remind extends ZZZPlugin {
|
||||||
if (userConfig && userConfig.remindTime) {
|
if (userConfig && userConfig.remindTime) {
|
||||||
await this.reply(`当前提醒时间: ${userConfig.remindTime}`);
|
await this.reply(`当前提醒时间: ${userConfig.remindTime}`);
|
||||||
} else {
|
} else {
|
||||||
const globalRemindTime = settings.getConfig('remind.globalRemindTime') || '每日20时';
|
const remindConfig = settings.getConfig('remind');
|
||||||
|
const globalRemindTime = remindConfig.globalRemindTime || '每日20时';
|
||||||
await this.reply(`个人提醒时间未设置,默认使用全局时间: ${globalRemindTime}`);
|
await this.reply(`个人提醒时间未设置,默认使用全局时间: ${globalRemindTime}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue