17TheWord / nonebot-plugin-mcqq

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

【错误反馈】互通导致命令失效 #114

Closed XuanXue2008 closed 4 weeks ago

XuanXue2008 commented 1 month ago

运行环境

almalinux9.4

NB插件及版本号

nonebot cli version 1.4.1

MC插件及版本号

1.21.1 QueQiao-spigot+1.13-0.0.2

错误描述

看不懂wiki文件配置🙌😭

报错日志(如果有)

08-20 15:27:57 [INFO] uvicorn | Shutting down
08-20 15:27:58 [INFO] uvicorn | Waiting for application shutdown.
08-20 15:27:58 [INFO] nonebot_plugin_apscheduler | Scheduler Shutdown
08-20 15:27:58 [INFO] uvicorn | Application shutdown complete.
08-20 15:27:58 [INFO] uvicorn | Finished server process [1336779]
Using python: /root/bot/mc_bot/.venv/bin/python
08-20 15:27:59 [SUCCESS] nonebot | NoneBot is initializing...
08-20 15:27:59 [INFO] nonebot | Current Env: dev
08-20 15:27:59 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi+~httpx+~websockets', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'dev', 'qq_is_sandbox': False, 'qq_bots': [{'id': '102066486', 'token': 'ciCflpUsu5nvEWGV3WkUyIvlfII3sibx', 'secret': 'WMC2tkbSJA1tldVNF81ungZTNHB5zupk', 'intent': {'c2c_group_at_messages': True}}], 'minecraft_ws_urls': {'Server': ['ws://127.0.0.1:8089']}, 'minecraft_server_rcon': {'Server': {'enable_rcon': True, 'rcon_port': 55521, 'rcon_password': '147159123aA@'}}, 'mc_qq_server_dict': {'Server': {'guild_list': [{'guild_id': '8976366802301288313', 'channel_id': '632231017', 'adapter': 'qq', 'bot_id': '102066486'}], 'rcon_msg': True, 'rcon_cmd': True}}}
08-20 15:27:59 [DEBUG] nonebot | Succeeded to load adapter "QQ"
08-20 15:27:59 [DEBUG] nonebot | Succeeded to load adapter "OneBot V12"
08-20 15:27:59 [DEBUG] nonebot | Succeeded to load adapter "Minecraft"
08-20 15:27:59 [SUCCESS] nonebot | Succeeded to load plugin "echo" from "nonebot.plugins.echo"
08-20 15:27:59 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_status"
08-20 15:27:59 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_apscheduler"
08-20 15:27:59 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_guild_patch"
08-20 15:27:59 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_mcqq"
08-20 15:27:59 [SUCCESS] nonebot | Running NoneBot...
08-20 15:27:59 [DEBUG] nonebot | Loaded adapters: QQ, OneBot V12, Minecraft
08-20 15:27:59 [INFO] uvicorn | Started server process [1337128]
08-20 15:27:59 [INFO] uvicorn | Waiting for application startup.
08-20 15:27:59 [INFO] nonebot_plugin_apscheduler | Scheduler Started
08-20 15:27:59 [DEBUG] nonebot | QQ | QQ run in sandbox mode: False
08-20 15:27:59 [DEBUG] nonebot | QQ | QQ api base url: https://api.sgroup.qq.com/
08-20 15:27:59 [DEBUG] nonebot | QQ | Bot 102066486 calling API shard_url_get
08-20 15:27:59 [INFO] uvicorn | Application startup complete.
08-20 15:27:59 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
08-20 15:27:59 [DEBUG] nonebot | Minecraft | WebSocket Connection to ws://127.0.0.1:8089 established
08-20 15:27:59 [INFO] nonebot | Minecraft | Connecting RCON for Bot Server
08-20 15:27:59 [ERROR] nonebot | Minecraft | Error while setup websocket to ws://127.0.0.1:8089. Trying to reconnect...
Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 46, in connect
    self._reader, self._writer = await asyncio.wait_for(
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
  File "uvloop/loop.pyx", line 2039, in create_connection
    raise exceptions[0]
  File "uvloop/loop.pyx", line 2016, in uvloop.loop.Loop.create_connection
    await waiter
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 256, in _connect_rcon
    await rcon.connect(timeout=server.timeout)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 54, in connect
    raise RCONConnectionError("The remote server refused the connection.", e)
aiomcrcon.errors.RCONConnectionError: The remote server refused the connection.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 25, in <module>
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run
    server.run()
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
> File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 153, in _forward_ws
    rcon = await self._connect_rcon(server_name, url.host)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 262, in _connect_rcon
    raise RCONConnectionError(e.message, e.error)
nonebot.adapters.minecraft.exception.RCONConnectionError: <NetWorkError message=The remote server refused the connection.>
08-20 15:28:00 [DEBUG] nonebot | QQ | WebSocket Connection to wss://api.sgroup.qq.com/websocket established
08-20 15:28:00 [INFO] nonebot | QQ | Bot 102066486 connected
08-20 15:28:00 [SUCCESS] nonebot | QQ 102066486 | [EventType.READY]: {'event_id': None, 'version': 1, 'session_id': '08aa0183-9192-4181-9911-b2beac2acbf7', 'user': {'id': '11855412983536797411', 'username': '萱雪酱的机器人', 'avatar': None, 'bot': True, 'union_openid': None, 'union_user_account': None}, 'shard': (0, 1)}
08-20 15:28:00 [DEBUG] nonebot | Checking for matchers in priority 1...
08-20 15:28:00 [DEBUG] nonebot | Checking for matchers in priority 4...
08-20 15:28:00 [DEBUG] nonebot | Checking for matchers in priority 5...
08-20 15:28:00 [DEBUG] nonebot | Checking for matchers in priority 10...
08-20 15:28:00 [DEBUG] nonebot | Checking for matchers completed
08-20 15:28:02 [DEBUG] nonebot | Minecraft | WebSocket Connection to ws://127.0.0.1:8089 established
08-20 15:28:02 [INFO] nonebot | Minecraft | Connecting RCON for Bot Server
08-20 15:28:02 [ERROR] nonebot | Minecraft | Error while setup websocket to ws://127.0.0.1:8089. Trying to reconnect...
Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 46, in connect
    self._reader, self._writer = await asyncio.wait_for(
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
  File "uvloop/loop.pyx", line 2039, in create_connection
    raise exceptions[0]
  File "uvloop/loop.pyx", line 2016, in uvloop.loop.Loop.create_connection
    await waiter
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 256, in _connect_rcon
    await rcon.connect(timeout=server.timeout)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 54, in connect
    raise RCONConnectionError("The remote server refused the connection.", e)
aiomcrcon.errors.RCONConnectionError: The remote server refused the connection.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 25, in <module>
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run
    server.run()
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
> File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 153, in _forward_ws
    rcon = await self._connect_rcon(server_name, url.host)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 262, in _connect_rcon
    raise RCONConnectionError(e.message, e.error)
nonebot.adapters.minecraft.exception.RCONConnectionError: <NetWorkError message=The remote server refused the connection.>
08-20 15:28:05 [DEBUG] nonebot | Minecraft | WebSocket Connection to ws://127.0.0.1:8089 established
08-20 15:28:05 [INFO] nonebot | Minecraft | Connecting RCON for Bot Server
08-20 15:28:05 [ERROR] nonebot | Minecraft | Error while setup websocket to ws://127.0.0.1:8089. Trying to reconnect...
Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 46, in connect
    self._reader, self._writer = await asyncio.wait_for(
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
  File "uvloop/loop.pyx", line 2039, in create_connection
    raise exceptions[0]
  File "uvloop/loop.pyx", line 2016, in uvloop.loop.Loop.create_connection
    await waiter
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 256, in _connect_rcon
    await rcon.connect(timeout=server.timeout)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 54, in connect
    raise RCONConnectionError("The remote server refused the connection.", e)
aiomcrcon.errors.RCONConnectionError: The remote server refused the connection.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 25, in <module>
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run
    server.run()
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
> File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 153, in _forward_ws
    rcon = await self._connect_rcon(server_name, url.host)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 262, in _connect_rcon
    raise RCONConnectionError(e.message, e.error)
nonebot.adapters.minecraft.exception.RCONConnectionError: <NetWorkError message=The remote server refused the connection.>
08-20 15:28:08 [DEBUG] nonebot | Minecraft | WebSocket Connection to ws://127.0.0.1:8089 established
08-20 15:28:08 [INFO] nonebot | Minecraft | Connecting RCON for Bot Server
08-20 15:28:08 [ERROR] nonebot | Minecraft | Error while setup websocket to ws://127.0.0.1:8089. Trying to reconnect...
Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 46, in connect
    self._reader, self._writer = await asyncio.wait_for(
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
  File "uvloop/loop.pyx", line 2039, in create_connection
    raise exceptions[0]
  File "uvloop/loop.pyx", line 2016, in uvloop.loop.Loop.create_connection
    await waiter
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 256, in _connect_rcon
    await rcon.connect(timeout=server.timeout)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/aiomcrcon/client.py", line 54, in connect
    raise RCONConnectionError("The remote server refused the connection.", e)
aiomcrcon.errors.RCONConnectionError: The remote server refused the connection.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 25, in <module>
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run
    server.run()
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
> File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 153, in _forward_ws
    rcon = await self._connect_rcon(server_name, url.host)
  File "/root/bot/mc_bot/.venv/lib/python3.12/site-packages/nonebot/adapters/minecraft/adapter.py", line 262, in _connect_rcon
    raise RCONConnectionError(e.message, e.error)
nonebot.adapters.minecraft.exception.RCONConnectionError: <NetWorkError message=The remote server refused the connection.>
17TheWord commented 1 month ago

既然防火墙开启了,关闭就行

XuanXue2008 commented 1 month ago

防火墙对应端口开启了也还是报这个

XuanXue2008 commented 1 month ago

链接问题解决了

XuanXue2008 commented 1 month ago

QQ ---> MC 又有新的问题了

XuanXue2008 commented 1 month ago

08-20 21:02:30 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_mcqq.minecraft_msg, lineno=14) failed. Traceback (most recent call last): File "", line 25, in File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/init.py", line 335, in run get_driver().run(*args, **kwargs) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run uvicorn.run( File "/root/bot/mc/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run server.run() File "/root/bot/mc/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/message.py", line 476, in check_and_run_matcher await _run_matcher(

File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/message.py", line 428, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/internal/matcher/matcher.py", line 850, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/internal/matcher/matcher.py", line 825, in simple_run await handler( File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/dependencies/init.py", line 94, in call return await cast(Callable[..., Awaitable[R]], self.call)(values) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot_plugin_mcqq/minecraft_msg.py", line 29, in handle_mc_msg await send_mc_msg_to_qq(event.server_name, msg_result) File "/root/bot/mc/.venv/lib/python3.12/site-packages/mcqq_tool/send_to_qq.py", line 46, in send_mc_msg_to_qq await bot.send_to_channel( File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/adapters/qq/bot.py", line 365, in send_to_channel return await self.post_messages( File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/internal/adapter/bot.py", line 122, in call_api raise exception File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/internal/adapter/bot.py", line 97, in call_api result = await self.adapter._call_api(self, api, data) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/adapters/qq/adapter.py", line 423, in _call_api return await api_handler(bot, *data) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/adapters/qq/utils.py", line 64, in call return await self.func(inst, args, **kwds) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/adapters/qq/bot.py", line 1004, in post_messages return type_validate_python(GuildMessage, await self._request(request)) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/adapters/qq/bot.py", line 551, in _request return self._handle_response(response) File "/root/bot/mc/.venv/lib/python3.12/site-packages/nonebot/adapters/qq/bot.py", line 540, in _handle_response raise ActionFailed(response) nonebot.adapters.qq.exception.ActionFailed: <ActionFailed: 500, code=304023, message=push message is waiting for audit now, data={'message_audit': {'audit_id': '6a0cf516-e04a-43b4-9716-0e82cb0eb979'}}, trace_id=2d650b0efeda737ea8298d40a65b470c>

17TheWord commented 1 month ago

这是QQ适配器的异常,push message is waiting for audit now 意思为:推送消息正在等待审核,另外这段日志是MC-》QQ的消息出现异常

XuanXue2008 commented 1 month ago

不会是因为这个吧 image

XuanXue2008 commented 1 month ago

感谢已解决!

XuanXue2008 commented 1 month ago

请问一下能否像"/say 你好"这样的格式 不然其他命令无法使用

17TheWord commented 1 month ago

不能,泛命令可能会阻断其他插件的信息

XuanXue2008 commented 1 month ago

互通导致其他命令无法使用 image image

17TheWord commented 1 month ago

暂未解决,等待更新,或者手动更新插件命令的优先级

XuanXue2008 commented 4 weeks ago

如何更改该插件的优先级呢?

XuanXue2008 commented 4 weeks ago

更改插件的init.py?