diff --git a/nonebot_plugin_bilichat/commands/functions.py b/nonebot_plugin_bilichat/commands/functions.py index d9e7e2c..5ebab79 100644 --- a/nonebot_plugin_bilichat/commands/functions.py +++ b/nonebot_plugin_bilichat/commands/functions.py @@ -32,7 +32,11 @@ async def check_dynamic_v11(target: MsgTarget, uid: Message = CommandArg()): await UniMessage(Image(raw=image)).send(target=target) -async def _bili_check(state: T_State, msg: UniMsg, target: MsgTarget) -> bool: +bili_fetch_content = bilichat.command("fetch", aliases=set(plugin_config.bilichat_cmd_fetch), block=True) + + +@bili_fetch_content.handle() +async def fetch_check(state: T_State, msg: UniMsg, target: MsgTarget): _msgs = msg.copy() if Reply in msg: # 如果是回复消息 @@ -56,7 +60,7 @@ async def _bili_check(state: T_State, msg: UniMsg, target: MsgTarget) -> bool: break if not bililink: - return False + raise FinishedException content: Column | Video | Dynamic | None = None @@ -80,18 +84,11 @@ async def _bili_check(state: T_State, msg: UniMsg, target: MsgTarget) -> bool: state["_content_"] = content else: raise AbortError(f"查询 {bililink} 返回内容为空") - - return True except AbortError as e: logger.info(e) - return False + raise FinishedException except FinishedException: - return False - - -bili_fetch_content = bilichat.command( - "fetch", aliases=set(plugin_config.bilichat_cmd_fetch), rule=_bili_check, block=True -) + raise FinishedException @bili_fetch_content.handle() diff --git a/nonebot_plugin_bilichat/content/dynamic.py b/nonebot_plugin_bilichat/content/dynamic.py index 2a960b4..0c4718b 100644 --- a/nonebot_plugin_bilichat/content/dynamic.py +++ b/nonebot_plugin_bilichat/content/dynamic.py @@ -112,8 +112,8 @@ async def fetch_content(self) -> list[bytes] | list[None]: items = self.raw["modules"]["module_dynamic"]["major"]["draw"]["items"] elif self.raw_type == "grpc": for module in self.raw["modules"]: - if module["module_type"] == "module_dynamic": - items = module["dynDraw"]["items"] + if module["moduleType"] == "module_dynamic": + items = module["moduleDynamic"]["dynDraw"]["items"] break for item in items: resq = await hc.get(item["src"]) diff --git a/pyproject.toml b/pyproject.toml index aca8dd1..eb15a56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "nonebot-plugin-bilichat" -version = "5.9.0" +version = "5.9.1" description = "多种B站链接解析,视频词云,AI总结,你想要的都在 bilichat" authors = [