From 578019156b3ea8ac2f927da8b0914ffb39cd518b Mon Sep 17 00:00:00 2001 From: Well404 <40534114+Well2333@users.noreply.github.com> Date: Sun, 12 Jan 2025 19:42:47 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9BAPI=20=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91=20(#283)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_bilichat/request_api/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nonebot_plugin_bilichat/request_api/base.py b/nonebot_plugin_bilichat/request_api/base.py index db569c2..ca4824b 100644 --- a/nonebot_plugin_bilichat/request_api/base.py +++ b/nonebot_plugin_bilichat/request_api/base.py @@ -16,8 +16,8 @@ class RequestAPI: def __init__( self, api_base: URL, api_token: str, weight: int, note: str = "", *, skip_version_checking: bool = False ) -> None: - if ".example.com" in str(api_base): - raise ValueError(f"请设置正确的 API 地址 --> {api_base}") + if ".example.com" in str(api_base.host_subcomponent): + raise ValueError(f"无效的 API URL: {api_base}, 请配置一个有效的 API") self._api_base = api_base self._api_token = api_token self._weight = weight