fix: 修复没有config不能查询

This commit is contained in:
Qian23333 2025-08-16 09:15:36 +08:00
parent c0542f8688
commit ffc664a857

View file

@ -185,10 +185,15 @@ export class Remind extends ZZZPlugin {
if (!uid) return false;
const targetUserId = this.e.user_id;
const userConfig = await this.getUserConfig(targetUserId);
let userConfig = await this.getUserConfig(targetUserId);
if (!userConfig) {
await this.reply('尚未设置任何提醒,请先设置阈值');
return false;
// 如果没有配置,使用默认配置
const defaultConfig = settings.getConfig('remind');
userConfig = {
enable: false, // 不开启提醒,仅用于查询
abyssCheckLevel: defaultConfig.abyssCheckLevel,
deadlyStars: defaultConfig.deadlyStars,
};
}
await this.reply('正在查询,请稍候...');
const messages = await this.checkUser(targetUserId, userConfig, true); // 主动查询,显示所有状态