diff --git a/nonebot_plugin_marshoai/tools/marshoai_meogirl/__init__.py b/nonebot_plugin_marshoai/tools/marshoai_meogirl/__init__.py index 5c960999..f303a486 100644 --- a/nonebot_plugin_marshoai/tools/marshoai_meogirl/__init__.py +++ b/nonebot_plugin_marshoai/tools/marshoai_meogirl/__init__.py @@ -1,16 +1,16 @@ -from . import mg_Info, mg_Introduce, mg_Search +from . import mg_info, mg_introduce, mg_search # meogirl async def meogirl(): - return mg_Info.meogirl() + return mg_info.meogirl() # Search async def search(msg: str, num: int = 3): - return str(await mg_Search.search(msg, num)) + return str(await mg_search.search(msg, num)) # Show async def introduce(msg: str): - return str(await mg_Introduce.introduce(msg)) + return str(await mg_introduce.introduce(msg)) diff --git a/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Introduce.py b/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Introduce.py index af0c49b9..abc13e2d 100644 --- a/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Introduce.py +++ b/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Introduce.py @@ -2,7 +2,7 @@ import re import urllib.parse import httpx -from bs4 import BeautifulSoup +from bs4 import BeautifulSoup # type: ignore from nonebot.log import logger headers = { @@ -64,9 +64,9 @@ async def introduce(msg: str): elif response.status_code == 404: logger.info(f'未找到"{msg}", 进行搜索') - from . import mg_Search + from . import mg_search - context = await mg_Search.search(msg, 1) + context = await mg_search.search(msg, 1) keyword = re.search(r".*?\n", context, flags=re.DOTALL).group()[:-1] # type: ignore logger.success(f'搜索完成, 打开"{keyword}"') diff --git a/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Search.py b/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Search.py index b65d751c..c8d05f97 100644 --- a/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Search.py +++ b/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_Search.py @@ -1,7 +1,7 @@ import urllib.parse import httpx -from bs4 import BeautifulSoup +from bs4 import BeautifulSoup # type: ignore from nonebot.log import logger headers = { @@ -76,9 +76,9 @@ async def search(msg: str, num: int): elif response.status_code == 302: logger.info(f'"{msg}"已被重定向至"{response.headers.get("location")}"') # 读取重定向结果 - from . import mg_Introduce + from . import mg_introduce - return await mg_Introduce.introduce(msg) + return await mg_introduce.introduce(msg) else: logger.error(f"网络错误, 状态码 : {response.status_code}")