fxxk-bot / bfv-bot

战地五QQ群机器人 | 支持战绩查询、屏蔽查询、周任务查询、加群自动改名片、黑名单进服提醒、卡排队提醒、自动宵禁、自定义命令名称...
5 stars 0 forks source link

程序增加服务器id 添加黑名单不能正常运行 加群通过后无入群和修改id通知 #4

Open 15h6 opened 1 month ago

15h6 commented 1 month ago

出现问题的功能

addblack功能绑定不成功

log文件夹内的日志

2024/10/11 - 03:09:31.395 DEBUG initialize/gin.go:44 msg:

2024/10/11 - 03:09:31.397 ERROR 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 ERROR initialize/gin.go:133 goroutine 462 [running]:

15h6 commented 1 month ago

程序增加服务器id不成功

375515498-693bfae0-3ee5-4530-9bfe-d8f1cb44b221

2024/10/11 - 03:19:20.112 DEBUG initialize/gin.go:44 msg:

2024/10/11 - 03:19:20.114 ERROR 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 "}

15h6 commented 1 month ago

同意加群后 无通知

375518851-9792c676-f8b8-4773-9c7f-db22eb971259

2024/10/11 - 03:31:39.572 DEBUG 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"}

AgMahone commented 1 month ago

服务器绑定功能我测试也存在问题,需要等待作者排查 黑名单添加需要与机器人私聊,并且命令格式为addblack=id,接下来机器人会回复一条消息让你输入原因。 加群修改名片使用文档明确标注,加群验证方式必须选择"需要回答问题并由管理员审核", 且问题必须为"游戏ID?(必须填写正确)" image

fxxk-bot commented 1 month ago

addblack和bindgameid需要私聊机器人触发

  1. addblack

图片

  1. bindgameid

服务器id是配置文件config.yaml内的服务器id

图片

  1. 自动修改群名片

需要机器人是管理员身份

15h6 commented 1 month ago

私聊机器人 没有反应

2024/10/11 - 09:50:29.061 DEBUG 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 INFO initialize/gin.go:60 [GIN] | 200 | 2ms | 127.0.0.1 | POST  "/api/event/post"

fxxk-bot commented 1 month ago
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号

15h6 commented 1 month ago

这边是我的qq号,看了数据库有这个黑名单的记录,可以正常删除

fxxk-bot commented 1 month ago

看截图的意思是 只有addblack没反应, 其他命令都行?

15h6 commented 1 month ago

是这样的情况,不提示黑名单添加过程,

fxxk-bot commented 1 month ago

好的, 把日志文件夹的debug.log/info.log/error.log传上来看看

15h6 commented 1 month ago

debug: 2024/10/11 - 14:28:46.524 DEBUG 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 DEBUG 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 DEBUG 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 DEBUG 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 DEBUG 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"}

| POST  "/api/event/post"

fxxk-bot commented 1 month ago

error.log呢

15h6 commented 1 month ago

我可以说没有吗

15h6 commented 1 month ago

是不是我接口设置的有问题 我之前设置服务器开启成功会通知绑定的管理员,现在设置半天一直没有

fxxk-bot commented 1 month ago

是的, 程序访问不到napcat服务, 部分命令就没回复了

fxxk-bot commented 1 month ago

启动时如果有这个错误日志的话, 说明程序时访问不到napcat的, 需要检查下配置

2024/10/11 - 14:55:12.143   ERROR  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"}
15h6 commented 1 month ago

佬 有没有详细的机器人napcat配置 我已经弄了好几天了 接口我也试了好多

fxxk-bot commented 1 month ago

napcat的配置可以参考README.md的示例

主要就是开启http访问和http上报. 保证程序能访问到napcat, napcat也能访问到程序.

fxxk-bot commented 1 month ago

你之前设置服务器开启成功会收到通知, 应该当时napcat和bot的配置没问题.

从你的截图和日志看, napcat现在是能正常访问到bot程序. 但是程序访问不到napcat了

你的配置后面有改什么吗

15h6 commented 1 month ago

我只改了机器人配置里的address地址 还有napcat里面的port和posturls.就是上面的图片

fxxk-bot commented 1 month ago

你那个图片看不见...

fxxk-bot commented 1 month ago

还是看不到.

配置以文字形式贴出来吧

15h6 commented 1 month ago

手打的,省略了一些符号 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

fxxk-bot commented 1 month ago

napcat http enable:false

这个要改成true

fxxk-bot commented 1 month ago

服务器绑定功能

@AgMahone 这个有问题的话 提个新的issue

fxxk-bot commented 1 month ago

功能bug, 提个新issue, 方便其他人查看