Code Monkey home page Code Monkey logo

go-mirai-client's Introduction

Go-Lagrange-Client

Go-Mirai-Client 已经停更,新项目已迁移至 Go-Lagrange-Client

默认端口9000,若启动失败,将依次在9001-9020端口中选择可用的端口启动。

用于收发QQ消息,并通过 websocket + protobuf 或 websocket + json 上报给 server 进行处理。

已支持与 OneBot V11 协议的服务端通信, 使用前需要选用 OneBot V11 协议

Golang 推荐使用 GoneBot TypeScript / JavaScript 推荐使用 ToneBot

可以使用任意语言编写websocket server实现通信,协议:onebot_glc

有问题发issue,或者进QQ群 901125207

支持的开发语言(需要根据协议修改):Java/Kotlin , JavaScript , TypeScript , Python , Golang , C/C++ , 易语言 。详情查看 Protobufbot

使用说明

  1. 启动程序

    • 用户在 Releases 下载适合自己的版本运行,然后手动打开浏览器地址http://localhost:9000/,Linux服务器可以远程访问http://<服务器地址>:9000
  2. 创建机器人

    • 建议选择扫码创建,使用机器人账号直接扫码,点击确认后登录。
    • 每次登录必须使用相同随机种子(数字),方便后续 session 登录。(建议使用账号作为随机种子)
  3. 配置消息处理器

    • 在首次启动自动生成的default.json中配置服务器URL,修改后重启生效。
    • 如果使用其他人编写的程序,建议把default.json打包在一起发送给用户。

多插件支持

支持多插件,且每个插件URL可以配置多个作为候选项

cd service/glc && go run *.go

go-mirai-client's People

Contributors

2mf8 avatar dependabot[bot] avatar lz1998 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-mirai-client's Issues

多websocket连接

希望能增加 被动连接websocket 且支持多个消息处理服务器进行连接

群发送图片上传失败

ERRO[2021-09-24 21:39:40] failed to upload group image, dial tcp 180.109.192.140:14000: i/o timeout
connect error
github.com/Mrs4s/MiraiGo/client.(*QQClient).highwayUploadByBDH
        github.com/Mrs4s/[email protected]/client/highway.go:121
github.com/Mrs4s/MiraiGo/client.(*QQClient).UploadGroupImage
        github.com/Mrs4s/[email protected]/client/image.go:60
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.preProcessGroupSendingMessage
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:98
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.HandleSendGroupMsg
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:173
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.handleApiFrame
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:181
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.OnWsRecvMessage.func1
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:143
github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws.NewSafeWebSocket.func2.1
        github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws/safe_ws.go:78
github.com/ProtobufBot/Go-Mirai-Client/pkg/util.SafeGo.func1
        github.com/ProtobufBot/Go-Mirai-Client/pkg/util/util.go:118
runtime.goexit
        runtime/asm_amd64.s:1581
upload failed
github.com/Mrs4s/MiraiGo/client.(*QQClient).UploadGroupImage
        github.com/Mrs4s/[email protected]/client/image.go:63
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.preProcessGroupSendingMessage
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:98
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.HandleSendGroupMsg
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:173
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.handleApiFrame
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:181
github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.OnWsRecvMessage.func1
        github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:143
github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws.NewSafeWebSocket.func2.1
        github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws/safe_ws.go:78
github.com/ProtobufBot/Go-Mirai-Client/pkg/util.SafeGo.func1
        github.com/ProtobufBot/Go-Mirai-Client/pkg/util/util.go:118
runtime.goexit
        runtime/asm_amd64.s:1581

私聊没问题,只会 failed to upload group image

编译不通过

go build -ldflags "-s -w -extldflags '-static'" -o gmc ./service/gmc

github.com/ProtobufBot/Go-Mirai-Client/pkg/bot

pkg/bot/bot.go:119:11: undefined: wrapper.RegisterSign

file issue

please add upload and download file of group and privite message. i need it very much

同学,您这个项目引入了63个开源组件,存在1个漏洞,辛苦升级一下

检测到 ProtobufBot/Go-Mirai-Client 一共引入了63个开源组件,存在1个漏洞

漏洞标题:Gin-Gonic Gin 环境问题漏洞
缺陷组件:github.com/gin-gonic/[email protected]
漏洞编号:CVE-2020-28483
漏洞描述:Gin-Gonic Gin是Gin-Gonic团队的一个基于Go语言的用于快速构建Web应用的框架。
github.com/gin-gonic/gin 全部版本存在安全漏洞,该漏洞源于可以通过设置X-Forwarded-For头来欺骗客户端的IP。
影响范围:(∞, 1.7.7)
最小修复版本:1.7.7
缺陷组件引入路径:main@->github.com/gin-gonic/[email protected]

另外还有几个漏洞,详细报告:https://mofeisec.com/jr?p=a10600

初始化 Sign 失败

WARN[2023-10-05 11:01:44] 0
WARN[2023-10-05 11:01:44] ?uin=0&android_id=&guid=&qimei36=&key=
WARN[2023-10-05 11:01:44] 初始化 Sign 失败
%!(EXTRA *url.Error=Get "/register?uin=0&android_id=&guid=&qimei36=&key=": unsupported protocol scheme "")

企点协议无法登录,当前应用版本过低

INFO[2023-08-18 17:21:55] 初始化日志
INFO[2023-08-18 17:21:55] 登录中...
INFO[2023-08-18 17:21:55] connect to server: [59.83.207.254:8080]
WARN[2023-08-18 17:21:55] 设备信息被封禁,请删除设备(device)文件夹里对应设备文件后重试
INFO[2023-08-18 17:21:55] 验证码处理页面: http://localhost:9000/
ERRO[2023-08-18 17:21:55] 当前应用版本过低,请升级至最新版或联系客服沟通。
WARN[2023-08-18 17:21:55] 登陆失败,建议开启/关闭设备锁后重试,或删除device-.json文件后再次尝试
ERRO[2023-08-18 17:21:55] 密码错误或账号被冻结
ERRO[2023-08-18 17:21:55] failed to login, err: 遇到不可处理的登录错误

新手疑惑

你好,在运行的时候在MyAspect.java变量log找不到符号,是什么意思。

密码登录的SignServer校验问题

版本0.3.0
1.密码创建账号的SignServer无法通过校验,具体的部分是在pkg/bot/bot.go 第73行

func Login(cli *client.QQClient) (bool, error) {  
	cli.AllowSlider = true  
	if GTL.ClientProtocol == 1 && GTL.SignServer != "" {  
		wrapper.DandelionEnergy = Energy  
		wrapper.FekitGetSign = Sign  
	} else if GTL.SignServer != "" {  
		fmt.Println("SignServer 不支持该协议")  
	}

我填的是我自己搭建的内网SignServer,框架为unidbg-fetch-qsign,内容为http://192.168.49.162:18901,但是不管怎么换协议,都会进入“SignServer 不支持该协议”的分支内。

群聊和私聊都遇到图片发送失败问题

腾讯云Linux, 出口带宽1M, 链接的图片大小为406kb

�[36mINFO�[0m[2021-10-01 17:39:52] Bot(1649565448) Private(649565448) <- <image url="http://域名/meituxiuxiu_7029.jpg"/> �[31mERRO�[0m[2021-10-01 17:40:12] failed to upload private image, dial tcp 180.102.111.81:14000: i/o timeout connect error github.com/Mrs4s/MiraiGo/client.(*QQClient).highwayUploadByBDH github.com/Mrs4s/[email protected]/client/highway.go:121 github.com/Mrs4s/MiraiGo/client.(*QQClient).UploadGroupImage github.com/Mrs4s/[email protected]/client/image.go:60 github.com/Mrs4s/MiraiGo/client.(*QQClient).uploadPrivateImage github.com/Mrs4s/[email protected]/client/image.go:135 github.com/Mrs4s/MiraiGo/client.(*QQClient).UploadPrivateImage github.com/Mrs4s/[email protected]/client/image.go:124 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.preProcessPrivateSendingMessage github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:51 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.HandleSendPrivateMsg github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:157 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.handleApiFrame github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:176 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.OnWsRecvMessage.func1 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:143 github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws.NewSafeWebSocket.func2.1 github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws/safe_ws.go:78 github.com/ProtobufBot/Go-Mirai-Client/pkg/util.SafeGo.func1 github.com/ProtobufBot/Go-Mirai-Client/pkg/util/util.go:118 runtime.goexit runtime/asm_amd64.s:1581 upload failed github.com/Mrs4s/MiraiGo/client.(*QQClient).UploadGroupImage github.com/Mrs4s/[email protected]/client/image.go:63 github.com/Mrs4s/MiraiGo/client.(*QQClient).uploadPrivateImage github.com/Mrs4s/[email protected]/client/image.go:135 github.com/Mrs4s/MiraiGo/client.(*QQClient).UploadPrivateImage github.com/Mrs4s/[email protected]/client/image.go:124 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.preProcessPrivateSendingMessage github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:51 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.HandleSendPrivateMsg github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/api_handler.go:157 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.handleApiFrame github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:176 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot.OnWsRecvMessage.func1 github.com/ProtobufBot/Go-Mirai-Client/pkg/bot/remote.go:143 github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws.NewSafeWebSocket.func2.1 github.com/ProtobufBot/Go-Mirai-Client/pkg/safe_ws/safe_ws.go:78 github.com/ProtobufBot/Go-Mirai-Client/pkg/util.SafeGo.func1 github.com/ProtobufBot/Go-Mirai-Client/pkg/util/util.go:118 runtime.goexit runtime/asm_amd64.s:1581

前端文件缺少

使用版本为0.3.0

  1. 源码编译遇到问题,没有前端文件。具体的报错是在pkg/static/static.go

//go:embed static
具体报错为
....\pkg\static\static.go:10:12: pattern static: no matching files found

我从已发布包中下载源码也没有发现前端文件。

群聊消息问题

版本0.3.0

1.群聊消息无法接收,私聊消息是正常的。登录协议我选择的是ipad,扫码登录。

增加反向ws连接token验证与自动登录

用反向ws连接云bot上游,因为过不了access_token验证,一直握手失败

time="2020-12-09 00:45:17" level=warning msg="连接Websocket服务器 ws://xn--v9x.net/ 时出现错误: websocket: bad handshake"

以及,似乎没有看到自动登录的设置。(如果是我眼拙,麻烦告知一下)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.