神代綺凛

[开源] 二次元搜图QQ机器人
因酷Q停止运营,本项目已转为依赖 go-cqhttp R.I.P. CoolQ
扫描右侧二维码阅读全文
13
2018/07

[开源] 二次元搜图QQ机器人

因酷Q停止运营,本项目已转为依赖 go-cqhttp

R.I.P. CoolQ

Head Pic: 「第六駆逐隊」/「ふわり」のイラスト [pixiv]

搜图机器人

QQ:*

抱歉,因各种复杂的原因,本体已经转为私用,现已不再公开允许加好友或群,有兴趣可自行部署玩耍

开源

项目最初是使用酷Q的易语言 SDK 开发,后使用 Node.js 重写并开源

开源版本不含咬人功能,因为懒得移植了……

用法及功能

请见 GitHub README 以及 wiki

示例

普通搜图

利用 ascii2d 搜索局部图

搜番

搜本子

搬瓦工VPS优惠套餐,建站稳如狗,支持支付宝,循环出账94折优惠码BWH3HYATVBJW
年付$47CN2线路,1核/1G内存/20G硬盘/1T@1Gbps【点击购买
季付$47CN2 GIA线路,1核/1G内存/20G硬盘/1T@2.5Gbps【点击购买
Last modification:July 21st, 2022 at 10:15 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment Cancel reply

667 comments

  1. ashj  Windows 10 x64 Edition(Windows 10 x64 Edition) / Firefox 81.0(Firefox 81.0)
    --doujin搜东西提示query错误之类的,只能出名字不能出链接
    更新没用
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.83(Google Chrome 85.0.4183.83)
      @ashj 搜不到就是搜不到,你可以去别的站点搜
      1. ashj  Windows 10 x64 Edition(Windows 10 x64 Edition) / Firefox 82.0(Firefox 82.0)
        @神代綺凜 但是有名字诶……
        (嘛似乎这时候已经好了)
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.83(Google Chrome 85.0.4183.83)
          @ashj 名字是 saucenao 得出的,通常是 mangadex,只有在线阅览,个人比较喜欢 nhentai 所以会去 nhentai 搜,搜不到是在 nhentai 搜不到
  2. 薄荷猫  Windows 10 x64 Edition(Windows 10 x64 Edition) / Sogou Explorer(Sogou Explorer)
    群里搜图的时候一直跳[ERROR]: Protocol -> long message send error. trying fragmented sending
    小白完全不懂解决,求教
  3. cuttlefish  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.83(Google Chrome 85.0.4183.83)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
      @cuttlefish 更新之后 npm i 了吗
      1. cuttlefish  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.102(Google Chrome 85.0.4183.102)
        @神代綺凜 我发现我虽然在 npm run test 之后会报错,但是在 npm start 的时候却可以正常运行,而机器人可以正常收发信息但是没法回应
        我使用的是
        go-cqhttp-v0.9.24 node-v12.18.3 npm-v6.14.6
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
          @cuttlefish npm start用的是 pm2 守护,你npx pm2 list看看就知道没有成功启动
      2. cuttlefish  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.102(Google Chrome 85.0.4183.102)
        @神代綺凜 我安装的是淘宝的 cnpm6.1.1
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
          @cuttlefish 刚才发的这个日志没用,我先删掉评论了,需要控制台原始输出

          另外发日志请用 markdown 代码块

          1. cuttlefish  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.102(Google Chrome 85.0.4183.102)
            @神代綺凜 自己又摸索了一段时间,发现是sqlite3的问题,现在问题已经解决可以正常使用了,感谢大佬的开发和解答!
  4. 沉程  Windows Server 2003(Windows Server 2003) / Google Chrome 62.0.3202.84(Google Chrome 62.0.3202.84)
    大佬,现在go-cqhttp可以加载酷q的插件不,萌新啥也不懂一直在摸索。。。
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
      @沉程 不能,go-cqhttp 只有 cqhttp 功能,要加载酷Q插件请用 mirai + mirai native 或 XQ + CQXQ 这类
  5. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.83(Google Chrome 85.0.4183.83)
    又来叨扰大佬了
    我最近看到一个先驱XQ框架,目前没有限制而且已经有人整了CQ转换,功能上我就别的插件看比Go-CQH/MIRAI还稳定点,使用上也贴近酷Q一点
    然后我发现我不会部署旧版本也就是CQHTTP对应版的这个插件orz,请问有啥教程吗
    1. 神代綺凜  Mac OS X 10.15.6(Mac OS X 10.15.6) / Google Chrome 84.0.4147.135(Google Chrome 84.0.4147.135)
      @KSHJ 部署旧版本?
      我看了看,流程跟 mirai + mirai native 那套应该是一样的,CQXQ 也有部署说明,cq-http 也有给 dll 和 json
  6. 狐白白  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.83(Google Chrome 85.0.4183.83)
    我部署成功之后setu也会发,但是我config写着30秒撤回,却没有撤回,是go-cqhttp不支持撤回吗?
    1. 狐白白  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 85.0.4183.83(Google Chrome 85.0.4183.83)
      @狐白白 貌似是说”获取信息时出现错误: key not found in the bucket id: 1301413049”可能是获取错消息ID了?
      1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
        1. 狐白白  Android 10(Android 10) / Google Chrome 85.0.4183.81(Google Chrome 85.0.4183.81)
          @神代綺凜 之前换成amd64就可以了,谢谢
  7. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
    话说咩,白名单群能设置多个吗
  8. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
    v2.15.4 和 go-0.19.20的话每个消息好像会发两次诶!
    确认过没有开重
    1. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
      @KSHJ 好吧,还是开重了,不知道开了三个无视我……
  9. MLUI  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
    最新版v2.15.4 在go-cqhttp-v0.9.19出现了转义的问题。
    私聊没事,但群里直接发送 [CQ:reply,id=1319472629][缓存] SauceNAO (95.08%)
    (ノ°ο°)ノ
    1. MLUI  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.125(Google Chrome 84.0.4147.125)
      @MLUI 换成amd64好了
  10. vanish shaojiu  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
    机器人v2.14.3;go-cqhttp v0.9.17;nodejs v14.7.0;npm -v 6.14.7
    npm run test无报错,私聊正常,群聊无回复;
    用pm2私聊也不回复,pm2版本4.4.0,看起来挺正常,status也是online,不知道什么问题
    1. vanish shaojiu  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @vanish shaojiu 换了12.18.3的lts版nodejs一切正常了
  11. Rye丶Ec  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
    安装完 发完图片出
    搜索失败惹 QAQ
    有可能是服务器网络爆炸,请重试一次
    用的是go-cqhttp平台
    1. Rye丶Ec  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @Rye丶Ec 大佬求助
  12. Asendenter  Android 9(Android 9) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
    go-cqhttp目前说不开发从群里发起的临时会话。以前酷Q平台上临时会话和好友私聊都可以触发on(message.private)事件,现在go-cqhttp平台只有好友私聊才触发on(message.private)事件(虽然会有重复消息的BUG)。大佬会修改go-cqhttp来实现触发临时会话吗
    1. 神代綺凜  Mac OS X 10.15.5(Mac OS X 10.15.5) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @Asendenter go-cqhttp 最新 release 已经支持群临时会话了,不过同时也加入了消息文本转义,待我今晚测试一下再更新
  13. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
    pili解析似乎不太对劲诶,最近老解析出些无相关的内容
    迁移后前两天没啥问题,大概是pili那边有啥改动?
    (顺便要是有空的话也整个知乎小程序解析呗=w=)
    1. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @KSHJ 可能我群太喜欢烧烤资本家的关系天天发被限制的稿件吧
      木事|´・ω・)ノ
  14. Ali  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.163(Google Chrome 80.0.3987.163)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
      @Ali 尝试修复了,更新一下项目并确保使用的是最新的 go-cqhttp 再试试
      1. Ali  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.163(Google Chrome 80.0.3987.163)
        @神代綺凜
        该评论仅登录用户及评论双方可见
    2. 神代綺凜  Mac OS X 10.15.5(Mac OS X 10.15.5) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @Ali 我大概知道了,今晚我看看这个问题
  15. Jkmiku  Windows 10 x64 Edition(Windows 10 x64 Edition) / Internet Explorer 11.0(Internet Explorer 11.0)
    大佬请教个问题,按照WIKI重新部署之后,开始一段时间是可以正常运行的,但是过来30分钟左右输入命令无返回信息。这有什么解决办法么
    1. 神代綺凜  Mac OS X 10.15.5(Mac OS X 10.15.5) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @Jkmiku 是否有确认使用最新版 go-cqhttp 和本项目

      如果情况依然存在,我晚上试验一下

      1. Jkmiku  Windows 10 x64 Edition(Windows 10 x64 Edition) / Internet Explorer 11.0(Internet Explorer 11.0)
        @神代綺凜 GO-CQHTTP是0.9.12的版本,PICFINDER是重新在github下载部署的
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
          @Jkmiku 测试了 go-cqhttp v0.9.14 没有复现这个问题
          1. Jkmiku  Windows 10 x64 Edition(Windows 10 x64 Edition) / Internet Explorer 11.0(Internet Explorer 11.0)
            @神代綺凜 已更新GO-CQHTTP谢谢大佬
  16. 晚上睡觉  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
    dalao,请问如何发送图片,在go-cqhttp他会有消息图片上传失败的警告
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
      @晚上睡觉 尝试修复了,更新一下项目并确保使用的是最新的 go-cqhttp 再试试
    2. 神代綺凜  Mac OS X 10.15.5(Mac OS X 10.15.5) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @晚上睡觉 发送本地图片请看 wiki 里的迁移须知
      1. 晚上睡觉  Android 10(Android 10) / Firefox 68.0(Firefox 68.0)
        @神代綺凜
        该评论仅登录用户及评论双方可见
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
          @晚上睡觉
          该评论仅登录用户及评论双方可见
          1. 晚上睡觉  Android 10(Android 10) / Firefox 68.0(Firefox 68.0)
            @神代綺凜
            该评论仅登录用户及评论双方可见
            1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
              @晚上睡觉
              该评论仅登录用户及评论双方可见
  17. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
    项目已转为依赖 go-cqhttp,请根据 wiki 部署或迁移
    1. lyn  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
      @神代綺凜 今天中午cqhttp-mirai更新了。
      说是修复CQCode转义逻辑, 现在CQ-picfinder-robot发送的SauceNao图片可正常显示了
      1. 星空  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.119(Google Chrome 83.0.4103.119)
        @lyn 您好,请问cqhttp-mirai要怎么设置,我这里显示连接失败
      2. 神代綺凜  Mac OS X 10.15.5(Mac OS X 10.15.5) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
        @lyn 总之我决定还是主要适配 go-cqhttp,原生 mirai 因为依赖 jre 导致体积非常大而且部署很麻烦,也只能依靠 miraiOK 这类一键包简化,go-cqhttp 的话因为用 go 重新实现了,编译出来体积也不大而且也跨平台,更友好一些

        当然如果有 mirai-native 需求那就没办法了

    2. Null  Mac OS X(Mac OS X) / Safari 13.1.2(Safari 13.1.2)
      @神代綺凜 刚刚迁移到mirai,看来是白忙活了hhh

      老哥辛苦了

      1. 神代綺凜  Mac OS X 10.15.5(Mac OS X 10.15.5) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
        @Null mirai-native + cq-http 试了下问题挺大的,不太行
  18. 寒夜方舟  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
    大佬可以移植到钉钉吗?φ( ̄∇ ̄o)
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
      @寒夜方舟 我没有在用的平台是不考虑移植的
      1. 寒夜方舟  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
        @神代綺凜 请问能否改造部署成带有api接口的后端,然后我再自己用钉钉机器人对接接口
        1. 神代綺凜  Mac OS X 10.15.5(Mac OS X 10.15.5) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
          @寒夜方舟 其实我在用的 node-cq-websocket SDK 就算吧,只不过对接的是 cq-http,如果你可以整一个钉钉用的 cq-http 就可以用了,或者看看有没有人已经做了
          1. 寒夜方舟  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
            @神代綺凜 目前来说的话,钉钉是支持webhook协议的,我目前也实现了最简单的复读。
            https://ding-doc.dingtalk.com/doc#/serverapi2/krgddi
            但我对nodejs其实也就一知半解,看不太懂你的代码
            请问您的这个QQ机器人是否兼容钉钉官方文档这样的token呢
            1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
              @寒夜方舟 都没往这方面做过当然是不兼容的
  19. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
    唔,mirai框架下用mirai-native+CQHTTP的话其他能用但是搜图完全没用了=。=
    MIRAI里日志大概像这样但是并没有回音啊
    06:48:52 [INFO] [BOT (BOTQQ)] [XX(群号)] XXXX(发送者QQ) -> [mirai:source:7412,1373333187][mirai:at:(BOTQQ),@BOT] [mirai:image:{3014C004-2BD5-E357-6014-F05C8E1A0F54}.mirai]
    06:48:52 [INFO] [MiraiNative] [CQHTTP WS] 已成功向 1/1 个 WebSocket 客户端推送事件
    另外小程序对抗似乎也不管用了(miraiOK好像是作为电脑登录的关系?)

    就是,mirai原生能用的CQHTTP-mirai一样不能用图片,就不太清楚是CQHTTP给插件返回了不对劲的内容还是Mirai-native本身就不能支持这个功能了(不过其他用app.dll+app.json直接加载的插件还是能正常认到图片的)
    文首有一句插件原本是酷Q SDK开发的,也不知道大佬有无意愿把编译好的app.dll和app.json放出来

    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
      @KSHJ 因为我收发图都用到了增强 CQ 码,估计是 mirai-native 加载 cq-http 并不支持这些

      我最早用酷Q SDK 开发的那都多少年前的事了,易语言源码早就被我删了,而且那时候只有最基本的搜图功能跟现在完全没法比

      1. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
        @神代綺凜 话说回来,会不会是mirai-native给CQHTTP推送的是mirai自己的类CQ码的报文所以大佬只要加一下对mirai码解码之类的支持这东西就可能完全复活了?
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
          @KSHJ 已经复活了,目前用 go-cqhttp,几乎不需要做改动,迁移请看项目 wiki
      2. KSHJ  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 84.0.4147.105(Google Chrome 84.0.4147.105)
        @神代綺凜 发图一点问题都没= =
        不过还能用就已经很欣慰了
  20. Sagiri°  Android 10(Android 10) / Google Chrome 80.0.3987.99(Google Chrome 80.0.3987.99)
    大佬,酷q无了?
    https://awesomeopensource.com/project/IOTQQ/IOTQQ
    不知道这个框架可不可以移植,有兴趣你可以看看
    对了,还有个基于这个框架的插件https://github.com/njjjay/IOTQQPlugins_selfuse