Open 15h6 opened 1 month ago
程序增加服务器id不成功
2024/10/11 - 03:19:20.112 [35mDEBUG[0m initialize/gin.go:44 msg:
2024/10/11 - 03:19:20.114 [31mERROR[0m initialize/gin.go:123 [Recovery from panic] {"error": "runtime error: invalid memory address or nil pointer dereference", "request": "POST /api/event/post HTTP/1.1 Host: 127.0.0.1:19997 Accept: / Accept-Encoding: gzip, deflate Accept-Language: * Connection: keep-alive Content-Length: 435 Content-Type: application/json Sec-Fetch-Mode: cors User-Agent: node X-Self-Id: 2689691641 "}
同意加群后 无通知
2024/10/11 - 03:31:39.572 [35mDEBUG[0m initialize/gin.go:44 msg: {"time":172899,"self_id":2681641,"post_type":"request","group_id":48318,"user_id":,"request_type":"group","comment":"问题:本群的密码是?\n答案:guac,"flag":"48328|172699765458|7","sub_type":"add"}
服务器绑定功能我测试也存在问题,需要等待作者排查 黑名单添加需要与机器人私聊,并且命令格式为addblack=id,接下来机器人会回复一条消息让你输入原因。 加群修改名片使用文档明确标注,加群验证方式必须选择"需要回答问题并由管理员审核", 且问题必须为"游戏ID?(必须填写正确)"
addblack和bindgameid需要私聊机器人触发
服务器id是配置文件config.yaml内的服务器id
需要机器人是管理员身份
私聊机器人 没有反应
2024/10/11 - 09:50:29.061 [35mDEBUG[0m initialize/gin.go:44 msg: {"user_id":115,"nickname","card":""},"raw_message":"addblack=a26391","font":14,"sub_type":"friend","message":[{"type":"text","data":{"text":"addblack=a2631"}}],"message_format":"array","post_type":"message"}
2024/10/11 - 09:50:29.065 [34mINFO[0m initialize/gin.go:60 [GIN] |[0;42m 200 [0m| 2ms | 127.0.0.1 |[0;48;2;120;220;232;38;2;255;255;255m POST [0m "/api/event/post"
qq-bot:
# napcat http服务地址
address: http://192.168.93.130:3001
# 机器人的qq
qq: 123123
# 加群欢迎信息
welcome-msg: " 本服已接入机器人,如被踢请仔细阅读服务器限制或使用机器人自助查询。"
# 管理员qq, 只有管理员能使用管理命令
admin-qq: 123123
# 发送黑名单/卡排队提醒的qq群
admin-group: 123123
# 启用机器人服务的群
active-group:
- 123123
检查qq-bot.admin-qq
这项是否为你的qq号
这边是我的qq号,看了数据库有这个黑名单的记录,可以正常删除
看截图的意思是 只有addblack
没反应, 其他命令都行?
是这样的情况,不提示黑名单添加过程,
好的, 把日志文件夹的debug.log/info.log/error.log传上来看看
debug: 2024/10/11 - 14:28:46.524 [35mDEBUG[0m initialize/gin.go:44 msg: {"self_id":261,"user_id":11time":1785,"message_id":16979"message_seq":1,"real_id":0,"message_type":"private","sender":{"user_id":115,"nickname":"","card":""},"raw_message":".help","font":14,"sub_type":"friend","message":[{"type":"text","data":{"text":".help"}}],"message_format":"array","post_type":"message"}
2024/10/11 - 14:28:51.298 [35mDEBUG[0m initialize/gin.go:44 msg: {"self_id":268941,"user_id":1145,"time":17,"message_id":2661,"message_seq":261,"real_id":261,"message_type":"private","sender":{"user_id":115,"nickname":","card":""},"raw_message":"addblack=a261","font":14,"sub_type":"friend","message":[{"type":"text","data":{"text":"addblack=a26641"}}],"message_format":"array","post_type":"message"}
2024/10/11 - 14:28:54.940 [35mDEBUG[0m initialize/gin.go:44 msg: {"self_id":281,"user_id":115,"time":173,"message_id":126,"message_seq":153,"real_id":16,"message_type":"private","sender":{"user_id":15,"nickname":"","card":""},"raw_message":"1","font":14,"sub_type":"friend","message":[{"type":"text","data":{"text":"1"}}],"message_format":"array","post_type":"message"}
2024/10/11 - 14:28:55.453 [35mDEBUG[0m utils/http.go:115 Get {"url": "https://api.bfvr", "stringResult": "{\"status\":1,\"message\":\"successful\",\"data\":{\"personaId\":116,\"name\":\"a2631\",\"userId\":166}}"} 2024/10/11 - 14:28:59.676 [35mDEBUG[0m initialize/gin.go:44 msg: {"self_id":26841,"user_id":115,"time":1728,"message_id":15,"message_seq":1,"real_id":195,"message_type":"private","sender":{"user_id":5,"nickname":"","card":""},"raw_message":"moveblack=a2641","font":14,"sub_type":"friend","message":[{"type":"text","data":{"text":"moveblack=a2641"}}],"message_format":"array","post_type":"message"}
|[0;48;2;120;220;232;38;2;255;255;255m POST [0m "/api/event/post"
error.log呢
我可以说没有吗
是不是我接口设置的有问题 我之前设置服务器开启成功会通知绑定的管理员,现在设置半天一直没有
是的, 程序访问不到napcat服务, 部分命令就没回复了
启动时如果有这个错误日志的话, 说明程序时访问不到napcat的, 需要检查下配置
2024/10/11 - 14:55:12.143 [31mERROR[0m utils/http.go:41 client.Do {"error": "Post \"http://127.0.0.1:3001/send_private_msg_async\": dial tcp 127.0.0.1:3001: connect: connection refused"}
佬 有没有详细的机器人napcat配置 我已经弄了好几天了 接口我也试了好多
napcat的配置可以参考README.md的示例
主要就是开启http访问和http上报. 保证程序能访问到napcat, napcat也能访问到程序.
你之前设置服务器开启成功会收到通知, 应该当时napcat和bot的配置没问题.
从你的截图和日志看, napcat现在是能正常访问到bot程序. 但是程序访问不到napcat了
你的配置后面有改什么吗
我只改了机器人配置里的address地址 还有napcat里面的port和posturls.就是上面的图片
你那个图片看不见...
还是看不到.
配置以文字形式贴出来吧
手打的,省略了一些符号 qq bot address http://127.0.0.1:6099
napcat http enable:false port:6099 enableheart:false enablepost:true posturls:http//127.0.0.1:19997/api/event/post
napcat http enable:false
这个要改成true
服务器绑定功能
@AgMahone 这个有问题的话 提个新的issue
功能bug, 提个新issue, 方便其他人查看
出现问题的功能
addblack功能绑定不成功
log文件夹内的日志
2024/10/11 - 03:09:31.395 [35mDEBUG[0m initialize/gin.go:44 msg:
2024/10/11 - 03:09:31.397 [31mERROR[0m initialize/gin.go:123 [Recovery from panic] {"error": "runtime error: invalid memory address or nil pointer dereference", "request": "POST /api/event/post HTTP/1.1 Host: 127.0.0.1:19997 Accept: / Accept-Encoding: gzip, deflate Accept-Language: * Connection: keep-alive Content-Length: 448 Content-Type: application/json Sec-Fetch-Mode: cors User-Agent: node X-Self-Id: 2689691641 "} 2024/10/11 - 03:09:31.402 [31mERROR[0m initialize/gin.go:133 goroutine 462 [running]: