mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🔧 chore: #wiki
功能 archive
This commit is contained in:
parent
bf297e2761
commit
a8b3a50d59
@ -41,10 +41,6 @@ export class query extends plugin {
|
||||
{
|
||||
reg: "^#竹白(.*)",
|
||||
fnc: "zhubaiSearch",
|
||||
},
|
||||
{
|
||||
reg: "^#(wiki|百科)(.*)$",
|
||||
fnc: "wiki",
|
||||
}
|
||||
],
|
||||
});
|
||||
@ -229,49 +225,6 @@ export class query extends plugin {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 百科
|
||||
async wiki(e) {
|
||||
const key = e.msg.replace(/#|百科|wiki/g, "").trim();
|
||||
const url = `https://xiaoapi.cn/API/bk.php?m=json&type=sg&msg=${ encodeURI(key) }`;
|
||||
const bdUrl = `https://xiaoapi.cn/API/bk.php?m=json&type=bd&msg=${ encodeURI(key) }`;
|
||||
const bkRes = await Promise.all([
|
||||
axios
|
||||
.get(bdUrl, {
|
||||
headers: {
|
||||
"User-Agent": COMMON_USER_AGENT,
|
||||
},
|
||||
timeout: 10000,
|
||||
})
|
||||
.then(resp => {
|
||||
return resp.data;
|
||||
}),
|
||||
axios
|
||||
.get(url, {
|
||||
headers: {
|
||||
"User-Agent": COMMON_USER_AGENT,
|
||||
},
|
||||
timeout: 10000,
|
||||
})
|
||||
.then(resp => {
|
||||
return resp.data;
|
||||
}),
|
||||
]).then(async res => {
|
||||
return res.map(item => {
|
||||
return {
|
||||
message: `
|
||||
解释:${ _.get(item, "msg") }\n
|
||||
详情:${ _.get(item, "more") }\n
|
||||
`,
|
||||
nickname: e.sender.card || e.user_id,
|
||||
user_id: e.user_id,
|
||||
};
|
||||
});
|
||||
// 小鸡解释:${ _.get(data2, 'content') }
|
||||
});
|
||||
await e.reply(await Bot.makeForwardMsg(bkRes));
|
||||
return true;
|
||||
}
|
||||
|
||||
// 删除标签
|
||||
removeTag(title) {
|
||||
const titleRex = /<[^>]+>/g;
|
||||
|
Loading…
x
Reference in New Issue
Block a user