Nova-Committee / McBot

A mod allowed you to connect minecraft and QQ
Other
115 stars 15 forks source link

[Bug/漏洞] 群聊接收不到消息 #132

Closed cyear closed 4 months ago

cyear commented 4 months ago

Checks / 检查

Java Version / Java版本

17.0.2

Minecraft Version / Minecraft版本

1.20.1

McBot Version / McBot版本

1.20.x-2.1.9.1

Description / 描述

游戏内消息无法转发到群里,控制台没看到报错,群聊到游戏正常

To Reproduce / 重现

100%触发

Log / 日志

[19:43:34] [Async Chat Thread - #4/INFO] [net.minecraft.server.MinecraftServer]: dkhjldsn

找不到哪里有报错

Config / 配置

通用

[common] group-on = true # 开启q群功能 guild-on = false # 是否开启频道 guild-id = "" # 频道id bot-id = enable = true # 是否启用 debug = false # 是否开发模式,将显示事件信息操作 language-select = "zh_cn" # 选择语言系统 auto-open = true # 自动连接 image-on = true # 是否开启聊天栏图片功能 group-id-list = channel-id-list = [] # 子频道列表

状态

[status] r-enable = true # 全局接收 r-cmd-enable = true # 命令接收 r-chat-enable = true # 消息接收 s-enable = true # 发送消息 s-qq-welcome-enable = true # 发送欢迎玩家入群消息 s-qq-leave-enable = true # 发送玩家退群消息 s-join-enable = true # 发送加入服务器消息 s-leave-enable = true # 发送离开服务器消息 s-death-enable = false # 发送玩家死亡消息 s-chat-enable = true # 发送服务器聊天 s-advance-enable = false # 发送成就消息

命令

[cmd] welcome-notice = "欢迎加群~" # 自定义q群加入事件消息 leave-notice = "离开了我们qwq" # 自定义q群离开消息 cmd-start = "!" # q群中使用命令的关键符号 game-prefix-on = true # 是否开启显示到游戏中的前缀 id-game-prefix-on = true # 是否开启显示到游戏中的id前缀 qq-game-prefix = "群聊" # 来自q群显示到游戏中的前缀 guild-game-prefix = "频道" # 来自频道显示到游戏中的前缀 group-nick-on = true # 是否开启显示到游戏中的昵称为群昵称 mc-prefix-on = true # 是否开启来自游戏的消息显示到群中的前缀 mc-prefix = "MC" # 来自游戏的消息显示到群中的前缀 mc-chat-prefix-on = false # 是否开启游戏中自定义关键词 qq-chat-prefix-on = false # 是否开启qq中自定义关键词 mc-chat-prefix = "q" # 游戏中自定义的消息头文本 qq-chat-prefix = "m" # qq中自定义的消息头文本

机器人

[bot_config] url = "ws://127.0.0.1:1000" token = "" bot-id = is-access-token = false mirai-http = false reconnect = true max-reconnect-attempts = 20 msg-type = "string"

cnlimiter commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

cyear commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

gocq机器人

cnlimiter commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

gocq机器人

gocq确实会有消息发不出的情况,建议换别的

cyear commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

gocq机器人

gocq确实会有消息发不出的情况,建议换别的

mirai我用key,他一直显示错误,都设为""才能连接成功

cnlimiter commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

gocq机器人

gocq确实会有消息发不出的情况,建议换别的

mirai我用key,他一直显示错误,都设为""才能连接成功

mcbot需要使用mirai模式

cyear commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

gocq机器人

gocq确实会有消息发不出的情况,建议换别的

mirai我用key,他一直显示错误,都设为""才能连接成功

mcbot需要使用mirai模式

[16:58:36] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: 已设置框 架的AuthKey为:xxx                                                     
[16:58:36] [Thread-2/INFO] []: [Config] /root/tsng5trialds/config/mcbot/config.toml Reload!                                                                       
[16:58:39] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: 尝试链接 框架mirai                                                                        
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: ▌ 已连接到服务器 ┈━═☆                                                                                
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: {"syncId":"","data":{"code":1,"msg":"Auth Key错误"}}                                                 
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: ▌ 服务器因Auth Key错误已关闭
cnlimiter commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

gocq机器人

gocq确实会有消息发不出的情况,建议换别的

mirai我用key,他一直显示错误,都设为""才能连接成功

mcbot需要使用mirai模式

[16:58:36] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: 已设置框 架的AuthKey为:xxx                                                     
[16:58:36] [Thread-2/INFO] []: [Config] /root/tsng5trialds/config/mcbot/config.toml Reload!                                                                       
[16:58:39] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: 尝试链接 框架mirai                                                                        
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: ▌ 已连接到服务器 ┈━═☆                                                                                
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: {"syncId":"","data":{"code":1,"msg":"Auth Key错误"}}                                                 
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: ▌ 服务器因Auth Key错误已关闭

emmmm,看来还是鉴权有问题,再修改

cnlimiter commented 4 months ago

请检查消息传输格式,是否匹配string或是array,一般mirai默认使用array

gocq机器人

gocq确实会有消息发不出的情况,建议换别的

mirai我用key,他一直显示错误,都设为""才能连接成功

mcbot需要使用mirai模式

[16:58:36] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: 已设置框 架的AuthKey为:xxx                                                     
[16:58:36] [Thread-2/INFO] []: [Config] /root/tsng5trialds/config/mcbot/config.toml Reload!                                                                       
[16:58:39] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: 尝试链接 框架mirai                                                                        
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: ▌ 已连接到服务器 ┈━═☆                                                                                
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: {"syncId":"","data":{"code":1,"msg":"Auth Key错误"}}                                                 
[16:58:39] [WebSocketConnectReadThread-116/INFO] [WSClient]: ▌ 服务器因Auth Key错误已关闭

emmmm,看来还是鉴权有问题,再修改

经测试,协议端onebot-mirai,先用指令mcbot setAuthKey xx,再使用mcbot connect mirai xxxxxx:xxxx,没有问题 6128bccd2f40a87a9e71b72f03abb8f0

cnlimiter commented 4 months ago

没问题先关闭了,后续有问题可以随时reopen