Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit 1f6179f

Browse files
xueelfDc_Yuki
authored andcommitted
fix bug
1 parent 2b322ed commit 1f6179f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

plugins/setu/search.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ module.exports = async (data, bot) => {
1414

1515
httpsRequest.get(url, params)
1616
.then((res) => {
17-
const { error, data } = res;
18-
19-
if (data.length > 0) {
17+
if (res.data.length > 0) {
2018
const { urls: { regular }, pid, title } = res.data[0];
2119

2220
reply(`[CQ:at,qq=${user_id}]\npid: ${pid}\ntitle: ${title}\n----------------\n图片下载中,请耐心等待喵`);
@@ -33,7 +31,7 @@ module.exports = async (data, bot) => {
3331

3432
lsp.set(user_id, lsp.get(user_id) + 1);
3533
} else {
36-
!error ? random(data, bot) : reply(error)
34+
!res.error ? random(data, bot) : reply(res.error)
3735
}
3836
})
3937
.catch(err => {

0 commit comments

Comments
 (0)