17TheWord / nonebot-plugin-mcqq

基于NoneBot的与Minecraft Server互通消息的插件
MIT License
96 stars 5 forks source link

【错误反馈】从群聊内向MC发送消息时报错 #117

Closed mrqx0195 closed 2 months ago

mrqx0195 commented 2 months ago

运行环境

WinServer 2022、Python3.12.2、Fluorite

NB插件及版本号

nonebot_plugin_mcqq-2.5.9

MC插件及版本号

QueQiao-forge+1.19.2-0.0.2

错误描述

从群聊内向MC发送消息时报错 从MC向群聊发送消息正常 (注:Fluorite服务端

报错日志(如果有)

08-24 23:37:07 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_mcqq.qq_msg, lineno=23) failed.
Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot\__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 186, in run
    uvicorn.run(
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\uvicorn\main.py", line 587, in run
    server.run()
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\uvicorn\server.py", line 62, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "C:\Program Files\Python312\Lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 639, in run_forever
    self._run_once()
  File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 1985, in _run_once
    handle._run()
  File "C:\Program Files\Python312\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot\message.py", line 476, in check_and_run_matcher
    await _run_matcher(
> File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot\message.py", line 428, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 850, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 825, in simple_run
    await handler(
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot\dependencies\__init__.py", line 94, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\nonebot_plugin_mcqq\qq_msg.py", line 46, in handle_qq_guild_msg
    await send_message_to_target_server(matcher=matcher, bot=bot, event=event)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\mcqq_tool\send_to_mc.py", line 307, in send_message_to_target_server
    return await __send_common_to_target_server(
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\mcqq_tool\send_to_mc.py", line 69, in event_check
    return await func(
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\mcqq_tool\send_to_mc.py", line 104, in wrapper
    return await func(
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\mcqq_tool\send_to_mc.py", line 184, in __send_common_to_target_server
    msg, text = await parse_qq_msg_to_rcon_model(bot=bot, event=event)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\mcqq_tool\parse_qq_msg.py", line 361, in parse_qq_msg_to_rcon_model
    message_list.append(group_name_component.get_component())
AttributeError: 'str' object has no attribute 'get_component'
17TheWord commented 2 months ago

rcon消息发送部分暂时有问题,可以先关闭 rcon_msg 配置项,用websocket发送消息

17TheWord commented 2 months ago

已在 v2.6.0 修复,请更新尝试

mrqx0195 commented 2 months ago

更新后正常运行,感谢