mirai 提供 QQ Android 协议支持的高效率机器人库
mirai 
 
使用 iTXTech MCL Installer 获取 mcl iTXTech MCL Installer 
新建目录
 
根据系统和架构选择对应文件:release 
1 2 3 curl -LJO https://gi thub.com/iTXTech/m cl-installer/releases/ download/2827601/m cl-installer-2827601 -linux-amd64 chmod +x mcl-installer-2827601 -linux-amd64 ./mcl-installer-2827601 -linux-amd64 
 
无特殊需求可一路回车,mcl就装好啦
使用 mcl 安装 mirai-api-http 1 ./mcl  --update-package  net.mamoe:mirai-api-http  --channel  stable --type  plugin
 
测试 http api:
 
如果要求滑块验证请看下一步
手动完成滑动验证 参考自 mirai-login-solver-selenium 
退出控制台,在 mirai 运行时中添加 JVM 属性 mirai.slider.captcha.supported 以启用手动验证
修改文件 mcl vim mcl 为如下内容:
1 2 3 #!/usr/bin/env sh export  JAVA_BINARY="/root/mcl/java/bin/java" $JAVA_BINARY  -Dmirai.slider.captcha.supported -jar mcl.jar $*
 
再次打开 mcl 并登录,用有桌面系统的电脑打开验证地址
F12 打开 DevTools,切换运行模式为 Android
切换到 Console,复制 captcha.inject.js  的内容全部复制至 Console 中并运行
复制传回的 ticket 并在 mcl 中输入,流程正确的话就能完成登陆了
验证 api 使用了 python sdk Graia Application  
安装:
1 pip install graia-application -mirai 
 
运行 Python 代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 from  graia.broadcast import  Broadcastfrom  graia.application import  GraiaMiraiApplication, Sessionfrom  graia.application.message.chain import  MessageChainimport  asynciofrom  graia.application.message.elements.internal import  Plainfrom  graia.application.friend import  Friendloop = asyncio.get_event_loop() bcc = Broadcast(loop=loop) app = GraiaMiraiApplication(     broadcast=bcc,     connect_info=Session(         host="http://localhost:8080" ,          authKey="0123456789" ,          account=88888888 ,          websocket=True       ) ) @bcc.receiver("FriendMessage"  ) async  def  friend_message_listener (message: MessageChain, friend: Friend, app: GraiaMiraiApplication ):    msg = message.asDisplay()     if  msg.startswith(".help" ):         await  app.sendFriendMessage(friend, MessageChain(__root__=[Plain(".help\t显示帮助指令\r\n.copy\t复读" )]))     elif  msg.startswith(".copy " ):         msg = msg[6 :]         await  app.sendFriendMessage(friend, MessageChain(__root__=[Plain(msg)]))     else :         await  app.sendFriendMessage(friend, MessageChain(__root__=[Plain("收到!" )])) app.launch_blocking() 
 
最后尝试给机器人发消息,收到回复就测试成功了