Bug: OneBot V11 和 V12 适配器均使用 `ONEBOT_WS_URLS` 配置导致报错
Closed this issue · 1 comments
This-is-XiaoDeng commented
在同时加载 OneBot V11 和 OneBot V12 适配器时,两个适配器都会对 ONEBOT_WS_URLS
配置的 URL 发起连接。
按照 文档,OneBot V12 适配器应该读取 ONEBOT_V12_WS_URLS
配置,而不是 ONEBOT_WS_URLS
配置。
以下是相关配置及截图:
.env 文件
HOST="0.0.0.0"
ALCONNA_USE_COMMAND_START=True
DRIVER=~fastapi+~httpx+~websockets
PORT=13576
LOG_LEVEL=DEBUG
COMMAND_START=["!"]
SUPERUSERS=["1744793737"]
ONEBOT_ACCESS_TOKEN="xdbot2@xiaodeng_114514"
ONEBOT_WS_URLS=["ws://127.0.0.1:3001"]
pyproject.toml 中的 tool.nonebot 节
[tool.nonebot]
adapters = [
{ name = "OneBot V12", module_name = "nonebot.adapters.onebot.v12" },
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" },
]
plugins = [
"nonebot_plugin_orm",
"nonebot_plugin_alconna",
"nonebot_plugin_picstatus",
"nonebot_plugin_htmlrender",
"nonebot_plugin_apscheduler",
"nonebot_plugin_session",
]
plugin_dirs = ["src/plugins"]
builtin_plugins = []
yanyongyu commented
设计就是这么设计的,为了方便所以可以简写,如果你要同时使用两个适配器,你就不应该简写,v11就用 onebot_v11_ws_urls
,v12就用 onebot_v12_ws_urls