HIT(Harbin Institue of Technology) Master graduates. Now work for NXP
- C / C++
- Rust
- Go
- Python
- Kotlin
- Verilog
Latex
- Full Stack
- Embedded (baremetal, embedded linux, FPGA)
- Deep leraning
- Zephyr is Fun
- Working
- Email [email protected]
- Telegram @Logiase
A template for MiraiGo
License: GNU Affero General Public License v3.0
HIT(Harbin Institue of Technology) Master graduates. Now work for NXP
PS Y:\q> go get github.com/Logiase/MiraiGo-Template
go: downloading github.com/Logiase/MiraiGo-Template v0.0.0-20210909051214-2b190772378a
go get: github.com/Logiase/MiraiGo-Template@none updating to
github.com/Logiase/[email protected] requires
github.com/willf/[email protected]: parsing go.mod:
module declares its path as: github.com/bits-and-blooms/bitset
but was required as: github.com/willf/bitset
遇到使用Android Phone时显示
Android Phone Protocol DO NOT SUPPORT Slide verify
please use other protocol
使用MacOS时显示
当前版本过低,请升级到QQ最新版本。
使用IPad和AndroidWatch时输入验证码后显示
当前上网环境异常,请更换网络环境或在常用设备上登录或稍后再试
能否问下
机器人启动并接收到一条消息后,miraiGO将会刷新出大量的历史消息,似乎最大消息数量为70条左右,而这可能会导致module中的命令在短时间内被频繁的触发。
比如在加载第三方Module:logiase.autoreply时,根据关键词,机器人可能会在短时间内大量的自动回复,造成疯狂刷屏的情况。
使用 device_test.go 生成 device.json后,登录提示这个。
time="2021-02-12T11:15:44+08:00" level=info msg="initializing modules ..." bot=internal
time="2021-02-12T11:15:44+08:00" level=info msg="all modules initialized" bot=internal
time="2021-02-12T11:15:44+08:00" level=info msg="registering modules serve functions ..." bot=internal
time="2021-02-12T11:15:44+08:00" level=info msg="all modules serve functions registered" bot=internal
time="2021-02-12T11:15:44+08:00" level=info msg="starting modules tasks ..." bot=internal
time="2021-02-12T11:15:44+08:00" level=info msg="tasks running" bot=internal
time="2021-02-12T11:15:44+08:00" level=fatal msg="login failed: 当前版本过低,请升级到QQ最新版本。" bot=internal
time="2021-03-19T17:41:18+08:00" level=fatal msg="login failed: 当前上网环境异常,请更换网络环境或在常用设备上登录或稍后再试。" bot=internal
请问这个问题该怎么解决?
如果我想实现多台机器服务一个机器人,如何做呢?
➜ make build
GOOS=linux GOARCH=amd64 \
go build -o bin/mirai-chess-bot-linux-amd64-v1.9.0 \
cmd/bot/bot.go
# github.com/Logiase/MiraiGo-Template/bot
../../../.golang/pkg/mod/github.com/!logiase/!mirai!go-![email protected]/bot/bot.go:58:16: undefined: client.SystemDeviceInfo
../../../.golang/pkg/mod/github.com/!logiase/!mirai!go-![email protected]/bot/bot.go:88:16: undefined: client.SystemDeviceInfo
../../../.golang/pkg/mod/github.com/!logiase/!mirai!go-![email protected]/bot/bot.go:99:44: undefined: client.SystemDeviceInfo
../../../.golang/pkg/mod/github.com/!logiase/!mirai!go-![email protected]/bot/protocol.go:18:9: undefined: client.SystemDeviceInfo
make: *** [Makefile:29: bin/mirai-chess-bot-linux-amd64-v1.9.0] Error 1
module github.com/aimerneige/MiraiChess
go 1.19
require (
github.com/Logiase/MiraiGo-Template v0.0.0-20221120093149-c0c90b30689e
github.com/Mrs4s/MiraiGo v0.0.0-20230220070519-af032dec9677
)
可以编译的版本:
module github.com/aimerneige/MiraiChess
go 1.19
require (
github.com/Logiase/MiraiGo-Template v0.0.0-20220412065005-27063e73adf8
github.com/Mrs4s/MiraiGo v0.0.0-20220828090150-a3c348100dfe
)
底层库不太了解,不知道哪里出了问题
INFO[0005] 扫码成功, 请在手机端确认登录. bot=internal
INFO[0008] start reload friends list bot=internal
INFO[0008] load 28 friends bot=internal
INFO[0008] start reload groups list bot=internal
INFO[0008] load 7 groups bot=internal
扫码登陆之后 加载到这里没反应了
本地代码是复制的app.go里的, 没有任何更改, 扫码登录之后, 只显示了几条加载好友和群组的日志, 发消息测试没有任何反应
time="2022-05-19T19:07:21+08:00" level=info msg="扫码成功, 请在手机端确认登录." bot=internal
time="2022-05-19T19:07:26+08:00" level=info msg="start reload friends list" bot=internal
time="2022-05-19T19:07:27+08:00" level=info msg="load 2 friends" bot=internal
time="2022-05-19T19:07:27+08:00" level=info msg="start reload groups list" bot=internal
time="2022-05-19T19:07:29+08:00" level=info msg="load 3 groups" bot=internal
机器人在线时间长后,就会只能接收消息,无法发送长消息(只能回复2个字以下)。
发送消息返回的message.GroupMessage.id为-1,时长为5s,初步判断是qq服务器没有响应导致的超时。
只能重新登录,但重新登录时间久后也会出现同样的问题。
情况与mamoe/mirai#527 相同,不清楚miraigo中有没有修复这个问题。
依赖已更新,但是无法登陆QQ,这是为啥呢?
time="2021-01-05T11:10:33+08:00" level=error msg="unable to read './device.json'" error="open ./device.json: The system cannot find the file specified." util=ReadFile
time="2021-01-05T11:10:33+08:00" level=info msg="creating device.json" bot=internal
time="2021-01-05T11:10:33+08:00" level=info msg="initializing modules ..." bot=internal
time="2021-01-05T11:10:33+08:00" level=info msg="all modules initialized" bot=internal
time="2021-01-05T11:10:33+08:00" level=info msg="registering modules serve functions ..." bot=internal
time="2021-01-05T11:10:33+08:00" level=info msg="all modules serve functions registered" bot=internal
time="2021-01-05T11:10:33+08:00" level=info msg="starting modules tasks ..." bot=internal
time="2021-01-05T11:10:33+08:00" level=info msg="tasks running" bot=internal
time="2021-01-05T11:10:33+08:00" level=fatal msg="login failed: 请你稍后重试。(0xa)" bot=internal
device.json
{"display":"MIRAI.565230.001","product":"mirai","device":"mirai","board":"mirai","model":"mirai","finger_print":"mamoe/mirai/mirai:10/MIRAI.200122.001/9686330:user/release-keys","boot_id":"4a655b1c-6e44-2092-c660-9454d62bc09c","proc_version":"Linux version 3.0.31-508syQmz ([email protected])","protocol":0,"imei":"938566290598518"}
考虑这样一个需求:在登陆成功后触发一次callback对所有好友/群组做一些操作,目前的callback Init/PostInit/Serve/Start并不能很好的支持这个操作。
WARN:这是一个break change。
device.json
文件要怎么获取?
发送文字信息可以通过message.NewSendingMessage().Append(message.NewText(“asdasd”))
构造进行发送
但是尝试使用
dat, _ := ioutil.ReadFile("1.jpg")
message.NewSendingMessage().Append(message.NewImage(dat))
进行构造时发送失败,图片显示裂开。
返回的InternalId显示是个负数,感觉可能是发送方式错误或者是账号被风控。
直接判断所需的device.json是否存在,如不存在直接生成,存在则读取设备文件。
感觉这样更方便,不这么做是有什么顾虑吗?
在网络环境不好时候存在超时,也就不会重试对应的bot就掉线了
该成为template的应该是Module的template吧?而不是整个项目
message
中 Data
为空
调用http对url
进行下载时,大概率下载为
已尝试如下
reqest, _ := http.NewRequest("GET", field.Url, nil)
reqest.Header.Add("Accept", "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8")
reqest.Header.Add("Accept-Encoding", "gzip, deflate, br")
reqest.Header.Add("Cache-Control", "no-cache")
reqest.Header.Add("Connection", "keep-alive")
reqest.Header.Add("Host", "gchat.qpic.cn")
reqest.Header.Add("Pragma", "no-cache")
reqest.Header.Add("Sec-Fetch-Dest", "image")
reqest.Header.Add("Sec-Fetch-Mode", "no-cors")
reqest.Header.Add("Sec-Fetch-Site", "cross-site")
reqest.Host = "gchat.qpic.cn"
r, err := http.DefaultClient.Do(reqest)
if err != nil {
return nil, err
}
defer r.Body.Close()
robots, err := ioutil.ReadAll(r.Body)
if err != nil {
return nil, err
}
和
t, err := request.QQClient.ImageOcr(field)
if err != nil {
return nil, err
}
上面的报错为服务忙,请稍后重试
直接调用wget url -O path
可以完成下载,但次数过多被腾讯限制
登录需要滑条验证码, 请使用手机QQ扫描二维码以继续登录. 出现这种问题的话一般各位如何解决,切换qrcode登录扫码的时候显示登陆环境不安全,请问有什么渠道能获取滑块的tik
#2
按照这个issue,我试了一下,他提示我para error
imageData, _ := ioutil.ReadFile("./text.jpg")
dataBuffer := bytes.NewReader(imageData)
pImage, err := b.UploadPrivateImage(msg.Sender.Uin, dataBuffer)
if err != nil{
fmt.Println("err: ",err)//para error
}
sendMessage := message.NewSendingMessage()
sendMessage.Append(pImage)
b.SendPrivateMessage(msg.Sender.Uin, sendMessage)
请问大佬,这个怎么解决啊
使用SendGroupMessage发送群消息,发送失败时,返回的GroupMessage.Id只有-1。
我遇到过有两个可能出现 -1
第1种是QQ风控,解决方法是修改消息体,重新发送就可以
第2种是限制发送群消息,这种没办法处理。
请问 哪里可以查看 -1 是 哪一种错误?
备注:使用了 https://github.com/Logiase/MiraiGo-Template 为模板进行开发
$ go run .
INFO[0000] initializing modules ... bot=internal
INFO[0000] all modules initialized bot=internal
INFO[0000] registering modules serve functions ... bot=internal
INFO[0000] all modules serve functions registered bot=internal
INFO[0000] starting modules tasks ... bot=internal
INFO[0000] tasks running bot=internal
FATA[0004] unable to login bot=internal error="unknown login response: 239"
exit status 1
2020-11-20 16:22:01 I/MiraiOK: MiraiOK 20200915.071520 linux-amd64
2020-11-20 16:22:01 I/MiraiOK: 此程序以Affero GPL3.0协议发布,使用时请遵守协议
2020-11-20 16:22:01 I/MiraiOK: 部分开源于: github.com/LXY1226/MiraiOK
2020-11-20 16:22:01 I/MiraiOK: openjdk version "11.0.8" 2020-07-14
2020-11-20 16:22:01 I/MiraiOK: OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
2020-11-20 16:22:01 I/MiraiOK: OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)
2020-11-20 16:22:02 I/MiraiOK: 删除.lastupdate来在下次启动时强制检查更新
2020-11-20 16:22:02 I/MiraiOK: 启动Mirai...
2020-11-20 16:22:03 I/main: Starting mirai-console...
2020-11-20 16:22:04 I/main: Backend: version 1.0-M4, built on 2020-09-13 02:19:35.
2020-11-20 16:22:04 I/main: Frontend Pure: version 1.0-M4, provided by Mamoe Technologies
2020-11-20 16:22:04 V/main: Loading configurations...
2020-11-20 16:22:05 V/main: Loading JVM plugins...
2020-11-20 16:22:05 I/plugin: Successfully loaded plugin MiraiApiHttp
2020-11-20 16:22:05 V/main: 0 external PluginLoader(s) found.
2020-11-20 16:22:05 V/main: 1 plugin(s) loaded.
2020-11-20 16:22:05 V/main: Loading PermissionService...
2020-11-20 16:22:05 V/main: Reloaded PermissionService settings.
2020-11-20 16:22:05 V/main: Loading built-in commands...
2020-11-20 16:22:06 V/main: Prepared built-in commands: help, login, permission, stop
2020-11-20 16:22:06 V/main: Enabling plugins...
2020-11-20 16:22:06 I/MiraiApiHttp: Starting Mirai HTTP Server in 0.0.0.0:8080
2020-11-20 16:22:06 I/MiraiApiHttp: Starting Mirai HTTP Server in 127.0.0.1:8080
2020-11-20 16:22:06 I/Mirai HTTP API: Http api server is running with authKey: *****authkey*redacted*****
2020-11-20 16:22:06 I/MiraiApiHttp: ????????: true
2020-11-20 16:22:06 I/MiraiApiHttp: ????????: true
2020-11-20 16:22:06 I/main: 1 plugin(s) enabled.
2020-11-20 16:22:06 I/main: Auto-login **qq*redacted**
2020-11-20 16:22:08 I/Bot **qq*redacted**: Logging in...
2020-11-20 16:22:10 I/Bot **qq*redacted**: Login successful
2020-11-20 16:22:10 I/main: mirai-console started successfully.
git clone https://github.com/Logiase/MiraiGo-Template
cd MiraiGo-Template
nano application.yaml # 填入账号信息
nano device.json # 填入对应生成信息
go run .
其中,
device.json
{"display":"MIRAI.758943.001","product":"mirai","device":"mirai","board":"mirai","model":"mirai","finger_print":"mamoe/mirai/mirai:10/MIRAI.200122.001/3365128:user/release-keys","boot_id":"fb6d9e88-5083-d91f-e
709-193f87d57f81","proc_version":"Linux version 3.0.31-Zhl6gYUl ([email protected])","protocol":0,"imei":"438950160030129"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.