Skip to content

Commit

Permalink
fix: upgrade iqdb-client (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
idranme authored Aug 14, 2024
1 parent af74122 commit b359c98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"cheerio": "^1.0.0-rc.12",
"iqdb-client": "^1.1.0",
"iqdb-client": "^3.0.0",
"nhentai-api": "^3.4.3"
},
"devDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions src/iqdb.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { searchPic } from 'iqdb-client'
import { searchPic, IQDB_RESULT_TYPE } from 'iqdb-client'
import { Quester, segment, Session } from 'koishi'

async function makeSearch(url: string): Promise<string> {
const res = await searchPic(url, { lib: 'www' })
if ('err' in res) {
return '搜图时遇到问题:' + res.err
} else if (res.ok || (res.data && res.data.length > 1)) {
const data: any = res.data[1]
const { head, sourceUrl, img, type, source } = data
const data = res.data[1]
const { head, sourceUrl, img, source } = data
const type: IQDB_RESULT_TYPE = (data as any).type

return [
segment('image', { url: 'https://iqdb.org' + img }),
Expand Down

0 comments on commit b359c98

Please sign in to comment.