fix: 修复消息正则

This commit is contained in:
Qian23333 2025-08-15 17:14:11 +08:00
parent 9b88b14353
commit 51801a7b9c
2 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ export class RemindManage extends ZZZPlugin {
priority: 40, // 管理插件优先级较高 priority: 40, // 管理插件优先级较高
rule: [ rule: [
{ {
reg: `${rulePrefix}设置全局提醒\\s*(每日\\d+时|每周.\\d+时)`, reg: `${rulePrefix}设置全局提醒时间\\s*(每日\\d+时|每周.\\d+时)`,
fnc: 'setGlobalRemind', fnc: 'setGlobalRemind',
permission: 'master', permission: 'master',
}, },
@ -45,7 +45,7 @@ export class RemindManage extends ZZZPlugin {
async setGlobalRemind() { async setGlobalRemind() {
const match = this.e.msg.match(/(每日\d+时|每周.\d+时)/); const match = this.e.msg.match(/(每日\d+时|每周.\d+时)/);
if (!match) return; if (!match) return;
const remindTime = match.trim(); const remindTime = match[1];
// 将全局提醒时间写入yaml配置 // 将全局提醒时间写入yaml配置
settings.setConfig('remind.globalRemindTime', remindTime); settings.setConfig('remind.globalRemindTime', remindTime);
@ -55,7 +55,7 @@ export class RemindManage extends ZZZPlugin {
async setMyRemindTime() { async setMyRemindTime() {
const match = this.e.msg.match(/(每日\d+时|每周.\d+时)/); const match = this.e.msg.match(/(每日\d+时|每周.\d+时)/);
if (!match) return; if (!match) return;
const remindTime = match.trim(); const remindTime = match[1];
let userConfig = await this.getUserConfig(this.e.user_id); let userConfig = await this.getUserConfig(this.e.user_id);
if (!userConfig) { if (!userConfig) {

View file

@ -126,7 +126,7 @@ export class Remind extends ZZZPlugin {
async setMyAbyssThreshold() { async setMyAbyssThreshold() {
const match = this.e.msg.match(/设置式舆阈值\s*(\d+)/); const match = this.e.msg.match(/设置式舆阈值\s*(\d+)/);
if (!match) return; if (!match) return;
const threshold = Number(match); const threshold = Number(match[1]);
if (threshold < 1 || threshold > 7) { if (threshold < 1 || threshold > 7) {
await this.reply('阈值必须在1到7之间'); await this.reply('阈值必须在1到7之间');
@ -151,7 +151,7 @@ export class Remind extends ZZZPlugin {
async setMyDeadlyThreshold() { async setMyDeadlyThreshold() {
const match = this.e.msg.match(/设置危局阈值\s*(\d+)/); const match = this.e.msg.match(/设置危局阈值\s*(\d+)/);
if (!match) return; if (!match) return;
const threshold = Number(match); const threshold = Number(match[1]);
let userConfig = await this.getUserConfig(this.e.user_id); let userConfig = await this.getUserConfig(this.e.user_id);
if (!userConfig) { if (!userConfig) {