ITADN

组服务器的部分似乎不能正常工作了

#67ClosedTianXing4675 创建于 2025-09-07
T
TianXing4675commented
我在1.1.6版本中的data/L4D2/l4d2.json里面添加一下的服务器信息: { "黑龙": [ { "id": 1, "ip": "47.116.119.109:27015" }, { "id": 2, "ip": "47.116.119.109:27016" }, { "id": 3, "ip": "47.116.119.109:27017" } ] } 但是不知道为什么重载完成之后nonebot2给出了这样的错误: 09-07 09:38:10 [SUCCESS] nonebot | OneBot V11 2194167005 | [message.group.normal]: Message 1401142616 from 2*********0@[群:*********] '/l4reload' 09-07 09:38:10 [DEBUG] nonebot | Checking for matchers in priority 1... 09-07 09:38:10 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.nonebot_plugin_l4d2_server.__main__, lineno=53) 09-07 09:38:10 [DEBUG] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_l4d2_server.__main__, lineno=53) 09-07 09:38:10 [DEBUG] nonebot | Running handler Dependent(call=_) 09-07 09:38:10 [SUCCESS] nonebot_plugin_l4d2_server | 成功加载 l4d2 3个 09-07 09:38:10 [SUCCESS] nonebot_plugin_l4d2_server | 重载ip完成 09-07 09:38:10 [INFO] nonebot_plugin_l4d2_server | 重载黑龙的ip 09-07 09:38:10 [INFO] nonebot | Matcher(type='message', module=src.plugins.nonebot_plugin_l4d2_server.__main__, lineno=53) running complete 09-07 09:38:10 [ERROR] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_l4d2_server.__main__, lineno=53) failed. Traceback (most recent call last): File "<string>", line 33, in <module> File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\__init__.py", line 337, in run get_driver().run(*args, **kwargs) File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run uvicorn.run( File "F:\l4d2bot\.venv\Lib\site-packages\uvicorn\main.py", line 580, in run server.run() File "F:\l4d2bot\.venv\Lib\site-packages\uvicorn\server.py", line 67, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\MrCr\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run return runner.run(main) File "C:\Users\MrCr\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "C:\Users\MrCr\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 673, in run_until_complete self.run_forever() File "C:\Users\MrCr\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 322, in run_forever super().run_forever() File "C:\Users\MrCr\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 640, in run_forever self._run_once() File "C:\Users\MrCr\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 1992, in _run_once handle._run() File "C:\Users\MrCr\AppData\Local\Programs\Python\Python312\Lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\utils.py", line 259, in run_coro_with_shield return await coro File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\message.py", line 508, in check_and_run_matcher await _run_matcher( > File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\message.py", line 460, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 926, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 863, in simple_run await handler( File "F:\l4d2bot\.venv\Lib\site-packages\nonebot\dependencies\__init__.py", line 113, in __call__ return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "F:\l4d2bot\src\plugins\nonebot_plugin_l4d2_server\__main__.py", line 212, in _ await L4API.get_sourceban(tag, url) File "F:\l4d2bot\src\plugins\nonebot_plugin_l4d2_server\utils\api\request.py", line 269, in get_sourceban if not (url.startswith(("http://", "https://"))): AttributeError: 'list' object has no attribute 'startswith' 09-07 09:38:10 [DEBUG] nonebot | Checking for matchers in priority 10... 09-07 09:38:10 [DEBUG] nonebot | Checking for matchers in priority 20... 09-07 09:38:10 [DEBUG] nonebot | Checking for matchers completed 你可以看到有URL的部分,我看了一下似乎是和sourceban++对接的,但是教程里面没有相关的部分,所以我在想你是不是应该更新一下readme.md了???
关闭于 2025-09-07 2 条评论