mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🎈 perf: 增加搜书安全性
This commit is contained in:
parent
ffa0a4dd08
commit
099c64c416
@ -309,23 +309,28 @@ export class query extends plugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 集成易书、zBook
|
// 集成易书、zBook
|
||||||
const bookList = await Promise.allSettled([getYiBook(e, keyword), getZBook(e, keyword)]);
|
try {
|
||||||
bookList
|
const bookList = await Promise.allSettled([getYiBook(e, keyword), getZBook(e, keyword)]);
|
||||||
.filter(one => one.status === "fulfilled")
|
bookList
|
||||||
.map(item => {
|
.filter(one => one.status === "fulfilled")
|
||||||
replyMessage(item.value);
|
.map(item => {
|
||||||
});
|
replyMessage(item.value);
|
||||||
|
});
|
||||||
|
|
||||||
const zHelper = await getZHelper(e, keyword);
|
const zHelper = await getZHelper(e, keyword);
|
||||||
if (zHelper && zHelper.length > 0) {
|
if (zHelper && zHelper.length > 0) {
|
||||||
await replyMessage(zHelper);
|
await replyMessage(zHelper);
|
||||||
const replyText =
|
const replyText =
|
||||||
"请选择一个你想要的ID、来源,例如:\n" +
|
"请选择一个你想要的ID、来源,例如:\n" +
|
||||||
"11918807 superlib\n" +
|
"11918807 superlib\n" +
|
||||||
"只回复11918807 默认zlibrary\n" +
|
"只回复11918807 默认zlibrary\n" +
|
||||||
"书源若不对应则回复无效链接,数字字母之间空格";
|
"书源若不对应则回复无效链接,数字字母之间空格";
|
||||||
await e.reply(replyText);
|
await e.reply(replyText);
|
||||||
this.setContext("searchBookContext");
|
this.setContext("searchBookContext");
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
logger.error(err);
|
||||||
|
e.reply("搜书正在施工🚧");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -345,8 +350,14 @@ export class query extends plugin {
|
|||||||
id = /\d+/.exec(keyword)[0];
|
id = /\d+/.exec(keyword)[0];
|
||||||
source = "";
|
source = "";
|
||||||
}
|
}
|
||||||
const res = await getBookDetail(e, id, source);
|
try {
|
||||||
await this.reply(await Bot.makeForwardMsg(res));
|
const res = await getBookDetail(e, id, source);
|
||||||
|
await this.reply(await Bot.makeForwardMsg(res));
|
||||||
|
} catch (err) {
|
||||||
|
logger.error(err);
|
||||||
|
e.reply("搜书正在施工🚧");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user