Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG?] 使用Lagrange时,引用Bot的信息,@的是QQ号而不是昵称 #144

Open
CC-3301 opened this issue Jan 9, 2025 · 4 comments
Assignees
Labels
错误(BUG) 它不起作用了吗?或者出现了意料之外的东西?

Comments

@CC-3301
Copy link

CC-3301 commented Jan 9, 2025

BUG:

如题,直接@机器人,游戏中出现的是@昵称,但引用消息@的就是QQ号,使用napcat协议端正常,用Lagrange才会这样

预期效果:

增强对Lagrange的兼容性?引用时@昵称而不是QQ号
还是说是协议端那边的问题?

MCDR及插件版本号

MCDR=2.14.3
GUGUbot=1.9.8
cq-qq-api=1.1.0

日志内容

gugubot的日志

[MCDR] [02:43:46] [TaskExecutor/INFO] [gugubot]: 收到消息上报:脱敏
[MCDR] [02:43:46] [TaskExecutor/WARNING] [gugubot]: 请检查QQ机器人消息格式! 需要: CQ码 或 text
[MCDR] [02:43:46] [TaskExecutor/DEBUG] [gugubot]: Sending command "tellraw @a ["",["",["",["",{"text":"<","color":"white"},{"text":"CC","color":"gold"}],{"text":">","color":"white"}],{"text":" @392**","color":"aqua"}],{"text":" test2","color":"white"}]"

lagrange的日志

info: Lagrange.Core.BotContext[0]
      [2025-01-09 18:50:11] [MessagingLogic] [VERBOSE]: [MessageChain(723895443)(276153251)] [Forward] Time: 01/09/2025 18:43:35 Sequence: 77945  | [Text]: test2
trce: Lagrange.Core.BotContext[0]
      [2025-01-09 18:50:11] [ServiceContext] [DEBUG]: Incoming SSOFrame: trpc.msg.olpush.OlPushService.MsgPush
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(852f4b58-8863-48be-bcf4-2edfeec4f222) {"message_type":"group","sub_type":"normal","message_id":813**,"group_id":脱敏,"user_id":脱敏,"anonymous":null,"message":[{"type":"reply","data":{"id":"813**"}},{"type":"text","data":{"text":"test2"}}],"raw_message":"[CQ:reply,id=813**]test2","font":0,"sender":{"user_id":脱敏,"nickname":"CC","card":"","sex":"unknown","age":0,"area":"","level":"99","role":"member","title":""},"time":1736448611,"self_id":392**,"post_type":"message"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[12]
      Receive(852f4b58-8863-48be-bcf4-2edfeec4f222) {"action": "get_group_member_info", "params": {"group_id": 脱敏, "user_id": 脱敏, "echo": "0a738cac-c14c-45ef-871a-fe565a4a0616"}, "echo": "0a738cac-c14c-45ef-871a-fe565a4a0616"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(852f4b58-8863-48be-bcf4-2edfeec4f222) {"status":"ok","retcode":0,"data":{"group_id":脱敏,"user_id":脱敏,"nickname":"CC","card":null,"sex":"","age":0,"area":"","join_time":1713334543,"last_sent_time":1736448207,"level":"99","role":"member","unfriendly":false,"title":"","title_expire_time":0,"card_changeable":false},"echo":"0a738cac-c14c-45ef-871a-fe565a4a0616"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[12]
      Receive(852f4b58-8863-48be-bcf4-2edfeec4f222) {"action": "get_group_member_info", "params": {"group_id": 脱敏, "user_id": 脱敏, "echo": "0c3f31ba-09c0-4869-ad00-1bb28064874e"}, "echo": "0c3f31ba-09c0-4869-ad00-1bb28064874e"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(852f4b58-8863-48be-bcf4-2edfeec4f222) {"status":"ok","retcode":0,"data":{"group_id":脱敏,"user_id":脱敏,"nickname":"CC","card":null,"sex":"","age":0,"area":"","join_time":1713334543,"last_sent_time":1736448207,"level":"99","role":"member","unfriendly":false,"title":"","title_expire_time":0,"card_changeable":false},"echo":"0c3f31ba-09c0-4869-ad00-1bb28064874e"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[12]
      Receive(852f4b58-8863-48be-bcf4-2edfeec4f222) {"action": "get_msg", "params": {"echo": "1ac72008-7883-45c7-9c75-921c8e0aabf5", "message_id": "813299468"}, "echo": "1ac72008-7883-45c7-9c75-921c8e0aabf5"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(852f4b58-8863-48be-bcf4-2edfeec4f222) {"status":"ok","retcode":0,"data":{"time":1736448215,"message_type":"group","message_id":813**,"real_id":81**,"sender":{"user_id":392**,"nickname":"\u8292\u679C\u5E03\u4E01","sex":"unknown"},"message":[{"type":"text","data":{"text":"CC_3301: test1"}}]},"echo":"1ac72008-7883-45c7-9c75-921c8e0aabf5"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[12]
      Receive(852f4b58-8863-48be-bcf4-2edfeec4f222) {"action": "get_login_info", "params": {"echo": "3e3f5a9b-8609-4ac6-9a1d-f0091ef03364"}, "echo": "3e3f5a9b-8609-4ac6-9a1d-f0091ef03364"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(852f4b58-8863-48be-bcf4-2edfeec4f222) {"status":"ok","retcode":0,"data":{"user_id":392**,"nickname":"\u8292\u679C\u5E03\u4E01"},"echo":"3e3f5a9b-8609-4ac6-9a1d-f0091ef03364"}

文件补充

上传文件于此
a67c35009c6cd71610b6532d33688422
image
image
image

@CC-3301 CC-3301 added the 错误(BUG) 它不起作用了吗?或者出现了意料之外的东西? label Jan 9, 2025
@XueK66
Copy link
Collaborator

XueK66 commented Jan 9, 2025

请检查一下 Lagrange 的消息格式 'message_type' 之类的是否为 'string' 或者 'CQ码',而不是 'array' 或 '消息段'

@XueK66 XueK66 added 需要更多信息 要解决它需要更多的信息 提供解决方案 不做处理但尽可能提供解决方案 labels Jan 10, 2025
@CC-3301
Copy link
Author

CC-3301 commented Jan 10, 2025

[MCDR] [13:04:38] [TaskExecutor/WARNING] [gugubot]: 请检查QQ机器人消息格式! 需要: CQ码 或 text
[MCDR] [13:04:38] [TaskExecutor/DEBUG] [gugubot]: Sending command "tellraw @a ["",["",["",["",{"text":"<","color":"white"},{"text":"CC","color":"gold"}],{"text":">","color":"white"}],{"text":" @392***","color":"aqua"}],{"text":" 1234","color":"white"}]"
info: Lagrange.Core.BotContext[0]
      [2025-01-10 04:55:14] [MessagingLogic] [VERBOSE]: [MessageChain(723895443)(276***)] [Forward] Time: 01/10/2025 04:52:47 Sequence: 78143  | [Text]: 1234
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(1cb26858-3596-4e88-a86d-7e3b2210afb3) {"message_type":"group","sub_type":"normal","message_id":826*,"group_id":***,"user_id":***,"anonymous":null,"message":"[CQ:reply,id=826*]1234","raw_message":"[CQ:reply,id=826*]1234","font":0,"sender":{"user_id":***,"nickname":"CC","card":"","sex":"unknown","age":0,"area":"","level":"99","role":"member","title":""},"time":1736484914,"self_id":***,"post_type":"message"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[12]
      Receive(1cb26858-3596-4e88-a86d-7e3b2210afb3) {"action": "get_group_member_info", "params": {"group_id": ***, "user_id": ***, "echo": "5c025cb9-d2a8-4337-a589-1edcd8a13da7"}, "echo": "5c025cb9-d2a8-4337-a589-1edcd8a13da7"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(1cb26858-3596-4e88-a86d-7e3b2210afb3) {"status":"ok","retcode":0,"data":{"group_id":***,"user_id":276***,"nickname":"CC","card":null,"sex":"","age":0,"area":"","join_time":1713334543,"last_sent_time":1736484913,"level":"99","role":"member","unfriendly":false,"title":"","title_expire_time":0,"card_changeable":false},"echo":"5c025cb9-d2a8-4337-a589-1edcd8a13da7"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[12]
      Receive(1cb26858-3596-4e88-a86d-7e3b2210afb3) {"action": "get_group_member_info", "params": {"group_id": 723***, "user_id": 276***, "echo": "8d829f87-e26e-42d0-ab27-ce2ad13bcf43"}, "echo": "8d829f87-e26e-42d0-ab27-ce2ad13bcf43"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(1cb26858-3596-4e88-a86d-7e3b2210afb3) {"status":"ok","retcode":0,"data":{"group_id":723***,"user_id":276***,"nickname":"CC","card":null,"sex":"","age":0,"area":"","join_time":1713334543,"last_sent_time":1736484913,"level":"99","role":"member","unfriendly":false,"title":"","title_expire_time":0,"card_changeable":false},"echo":"8d829f87-e26e-42d0-ab27-ce2ad13bcf43"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[12]
      Receive(1cb26858-3596-4e88-a86d-7e3b2210afb3) {"action": "get_msg", "params": {"echo": "9d941eda-99f7-4c60-b879-0e4fef46141a", "message_id": "826***"}, "echo": "9d941eda-99f7-4c60-b879-0e4fef46141a"}
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(1cb26858-3596-4e88-a86d-7e3b2210afb3) {"status":"ok","retcode":0,"data":{"time":1736484767,"message_type":"group","message_id":826***,"real_id":826***,"sender":{"user_id":392***,"nickname":"\u8292\u679C\u5E03\u4E01","sex":"unknown"},"message":[{"type":"text","data":{"text":"CC_3301\u8FDB\u5165\u4E86\u670D\u52A1\u5668"}}]},"echo":"9d941eda-99f7-4c60-b879-0e4fef46141a"}

@XueK66 XueK66 removed 需要更多信息 要解决它需要更多的信息 提供解决方案 不做处理但尽可能提供解决方案 labels Jan 10, 2025
@CC-3301
Copy link
Author

CC-3301 commented Jan 10, 2025

还有Lagrange发表情会这样
image

@CC-3301
Copy link
Author

CC-3301 commented Jan 10, 2025

mface表情会这样
image

message.py补一条正则就好

content = re.sub(r'\[CQ:mface\]&#91;(.*?)&#93;.*?', r'[表情: \1]', content)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
错误(BUG) 它不起作用了吗?或者出现了意料之外的东西?
Projects
None yet
Development

No branches or pull requests

2 participants