17TheWord / nonebot-plugin-mcqq

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

【错误反馈】群聊内向服务器发送指令时Nonebot端出现报错 #94

Closed YuYue-Amatsuki closed 4 months ago

YuYue-Amatsuki commented 4 months ago

运行环境

Ubuntu 22.04 LTS、Python3.10、PurPur-1.20.4

NB插件及版本号

2.5.7

MC插件及版本号

2.7.0

错误描述

群聊内向服务器发送指令时报错

报错日志(如果有)

05-27 17:59:36 [SUCCESS] nonebot | OneBot V11 25*****89 | [message.group.normal]: Message 1695837147 from 245*****73@[群:97*****92] 'mcc list'
05-27 17:59:36 [DEBUG] nonebot | Running PreProcessors...
05-27 17:59:36 [DEBUG] nonebot | Checking for matchers in priority 1...
05-27 17:59:36 [DEBUG] nonebot | Checking for matchers in priority 2...
05-27 17:59:36 [DEBUG] nonebot | Checking for matchers in priority 4...
05-27 17:59:36 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_mcqq.qq_msg, lineno=24)
05-27 17:59:36 [DEBUG] nonebot | Running Matcher(type='message', module=nonebot_plugin_mcqq.qq_msg, lineno=24)
05-27 17:59:36 [DEBUG] nonebot | Running handler Dependent(call=handle_qq_group_cmd)
05-27 17:59:36 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_mcqq.qq_msg, lineno=24) running complete
05-27 17:59:36 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_mcqq.qq_msg, lineno=24) failed.
Traceback (most recent call last):
  File "/home/yuyue/nonebot/yuyue-nonebot/bot.py", line 22, in <module>
    nonebot.run(app="__mp_main__:app")
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/home/yuyue/.local/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
    server.run()
  File "/home/yuyue/.local/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/message.py", line 476, in check_and_run_matcher
    await _run_matcher(
> File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/message.py", line 428, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 850, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 825, in simple_run
    await handler(
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 94, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot_plugin_mcqq/qq_msg.py", line 67, in handle_qq_group_cmd
    temp_result = await send_command_to_target_server(matcher=matcher, bot=bot, event=event, command=cmd)
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcqq_tool/send_to_mc.py", line 226, in send_command_to_target_server
    return await __send_common_to_target_server(
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcqq_tool/send_to_mc.py", line 69, in event_check
    return await func(
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcqq_tool/send_to_mc.py", line 104, in wrapper
    return await func(
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcqq_tool/send_to_mc.py", line 160, in __send_common_to_target_server
    response = await mc_bot.send_rcon_cmd(command)
TypeError: Bot.call_api() takes 2 positional arguments but 3 were given
17TheWord commented 4 months ago

新的工具包已经修复,使用 pip install -U mcqq-tool 更新工具包再次尝试