17TheWord / nonebot-plugin-mcqq

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

【错误反馈】@全体成员 时报错 #122

Closed mrqx0195 closed 1 month ago

mrqx0195 commented 1 month ago

运行环境

WinServer 2022、Python3.12.2、Fluorite

NB插件及版本号

nonebot_plugin_mcqq-2.6.2

MC插件及版本号

QueQiao-forge+1.19.2-0.0.4

错误描述

QQ群内发送的消息包含 @全体成员 时报错

报错日志(如果有)

09-17 23:25:40 [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 376, in parse_qq_msg_to_rcon_model
    temp_message_list, log_msgs = await __get_common_qq_msg_parsing(bot=bot, event=event, rcon_mode=True)
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\mcqq_tool\parse_qq_msg.py", line 201, in __get_common_qq_msg_parsing
    temp_text = f"@{await __get_group_or_nick_name(bot, event, msg.data['qq'])}"
  File "C:\Users\Administrator\Desktop\Chikari\.venv\Lib\site-packages\mcqq_tool\parse_qq_msg.py", line 43, in __get_group_or_nick_name
    if event.user_id == int(user_id):
ValueError: invalid literal for int() with base 10: 'all'
17TheWord commented 1 month ago

已在工具包 1.3.2 更新 pip install mcqq-tool==1.3.2