移除apps插件非必要return false,拦截指令向后传递 #138

This commit is contained in:
UCPr 2025-09-09 03:30:27 +08:00
parent 3273f256fc
commit 9d676fa70a
17 changed files with 82 additions and 173 deletions

View file

@ -69,8 +69,7 @@ export class Guide extends ZZZPlugin {
}
group = Number(group);
if (group > guides.guideMaxNum) {
await this.reply(`超过攻略数量(${guides.guideMaxNum}`);
return false;
return this.reply(`超过攻略数量(${guides.guideMaxNum}`);
}
if (alias === '设置默认' || alias === '设置所有') {
return false;
@ -79,8 +78,7 @@ export class Guide extends ZZZPlugin {
const name = char.aliasToName(alias);
if (!name) {
await this.reply('该角色不存在');
return false;
return this.reply('该角色不存在');
}
if (group === 0) {
@ -102,20 +100,17 @@ export class Guide extends ZZZPlugin {
if (msg.length) {
await this.reply(await common.makeForwardMsg(this.e, msg));
}
return false;
}
const guidePath = await this.getGuidePath(group, name, !!isUpdate);
if (!guidePath) {
this.e.reply(
return this.e.reply(
`暂无${name}攻略 (${
guides.guideSources[group - 1]
})\n请尝试其他的攻略来源查询`
);
return false;
}
await this.e.reply(segment.image(guidePath));
return false;
}
/** 下载攻略图 */
@ -128,9 +123,8 @@ export class Guide extends ZZZPlugin {
try {
mysRes = await Promise.all(mysRes);
} catch (error) {
this.e.reply('暂无攻略数据,请稍后再试');
console.log(`米游社接口报错:${error}}`);
return false;
return this.e.reply('暂无攻略数据,请稍后再试');
}
// 搜索时过滤特殊符号譬如「11号」