fix:攻略提示

This commit is contained in:
yysforget 2024-07-31 17:55:13 +08:00
parent 2c745c256e
commit 7bb1fd71a4

View file

@ -106,7 +106,7 @@ export class Guide extends ZZZPlugin {
group = _.get(settings.getConfig('guide'), 'default_guide', 1).toString(), group = _.get(settings.getConfig('guide'), 'default_guide', 1).toString(),
] = this.e.msg.match(reg); ] = this.e.msg.match(reg);
// all -> 0 // all -> 0
if (group == 'all') { if (group === 'all') {
group = '0'; group = '0';
} }
group = Number(group); group = Number(group);
@ -128,15 +128,23 @@ export class Guide extends ZZZPlugin {
// msg.push(segment.image(`file://${guidePath}`)); // msg.push(segment.image(`file://${guidePath}`));
if (guidePath) { if (guidePath) {
msg.push(segment.image(guidePath)); msg.push(segment.image(guidePath));
} else {
msg.push(`暂无${name}攻略 (${this.source[i - 1]})`)
} }
} }
if (msg.length) { if (msg.length) {
await this.reply(await common.makeForwardMsg(this.e, [msg])); await this.reply(await common.makeForwardMsg(this.e, msg));
} }
return false; return false;
} }
const guidePath = await this.getGuidePath(group, name, !!isUpdate); const guidePath = await this.getGuidePath(group, name, !!isUpdate);
if (!guidePath) {
this.e.reply(
`暂无${name}攻略 (${this.source[group - 1]})\n请尝试其他的攻略来源查询`
);
return false;
}
await this.e.reply(segment.image(guidePath)); await this.e.reply(segment.image(guidePath));
return false; return false;
} }
@ -182,9 +190,6 @@ export class Guide extends ZZZPlugin {
} }
} }
if (!url) { if (!url) {
this.e.reply(
`暂无${name}攻略 (${this.source[group - 1]})\n请尝试其他的攻略来源查询`
);
return false; return false;
} }
logger.debug( logger.debug(