koishi-plugin-image-search
TypeScript icon, indicating that this package has built-in type declarations

4.3.0 • Public • Published

koishi-plugin-image-search

npm

koishi-plugin-image-search 封装了一系列搜图相关的指令,目前支持以下平台:

参考了 Tsuk1ko 的机器人实现。

指令:image-search

  • 别名:搜图

image-search 指令检测当前输入中的全部图片,并依次进行搜索。如果 image-search 所在消息内没有检测到图片,则该指令会给出提示,并对下一条信息中的图片进行处理。

在搜索过程中,image-search 指令会首先使用 saucenao 进行搜索,当相似度低于 60% 时,会在搜索完成后使用 ascii2d 再次搜索。当相似度低于 40% 时,将不会显示 saucenao 本身的搜索结果(但是 ascii2d 的结果会显示)。

指令:saucenao

saucenao 指令是 image-search 指令的子指令。它使用 saucenao 进行图片搜索,机制与上面完全相同,但当相似度较低时不会使用 ascii2d 再次搜索,也不会略去本身的搜索结果。

指令:ascii2d

ascii2d 指令也是 image-search 指令的子指令。它使用 ascii2d 进行图片搜索,机制与上面完全相同。

配置项

saucenaoApiKey

  • 类型: string | string[]

可用的 SauceNAO API key 列表。SauceNAO 的 API key 可以通过注册 SauceNAO 账户的方式获取。注册后即可在 API 页中获取到 API key。如果填入多个 API key,则会自动进行负载均衡。

lowSimilarity

  • 类型: number
  • 默认值: 40

相似度较低的认定标准(百分比)。

highSimilarity

  • 类型: number
  • 默认值: 60

相似度较高的认定标准(百分比)。

output.thumbnail

  • 类型: boolean
  • 默认值: true

是否在搜索结果中显示缩略图。

Dependencies (3)

Dev Dependencies (3)

Package Sidebar

Install

npm i koishi-plugin-image-search

Weekly Downloads

32

Version

4.3.0

License

MIT

Unpacked Size

26.8 kB

Total Files

19

Last publish

Collaborators

  • shigma