diff --git a/plugins/fanhao_search/config.toml b/plugins/fanhao_search/config.toml index be357f1..73258b0 100644 --- a/plugins/fanhao_search/config.toml +++ b/plugins/fanhao_search/config.toml @@ -9,7 +9,7 @@ command-format = """ # MongoDB 连接 mongo_uri = "mongodb+srv://readonly:cS9NSuiJ1ebHnUL0@cluster0.8mosa.mongodb.net/sehuatang?retryWrites=true&w=majority" db = "sehuatang" -collections = ["asia_codeless_originate", "asia_mosaic_originate","4k_video"] +collections = ["hd_chinese_subtitles", "asia_codeless_originate", "asia_mosaic_originate","4k_video"] # 尝试匹配的字段名(存在其一即可) search_fields = ["number"] diff --git a/plugins/fanhao_search/main.py b/plugins/fanhao_search/main.py index 6eedea7..eb6c85b 100644 --- a/plugins/fanhao_search/main.py +++ b/plugins/fanhao_search/main.py @@ -71,7 +71,7 @@ class FanhaoSearchPlugin(MessagePluginInterface): ) self.mongo_db_name = cfg.get("db", "sehuatang") self.collections = cfg.get( - "collections", ["asia_codeless_originate", "asia_mosaic_originate","4k_video"] + "collections", ["hd_chinese_subtitles", "asia_codeless_originate", "asia_mosaic_originate", "4k_video"] ) self.search_fields = cfg.get("search_fields", ["number"]) # 可能的字段名 @@ -166,7 +166,7 @@ class FanhaoSearchPlugin(MessagePluginInterface): queries = self._build_queries(code_upper) self.LOG.debug(f"[{self.name}] 标准化番号={code_upper},查询字段={self.search_fields}") for idx, query in enumerate(queries): - self.LOG.debug(f"[{self.name}] 执行查询({idx+1}/{len(queries)}): {query}") + self.LOG.debug(f"[{self.name}] 执行查询({idx + 1}/{len(queries)}): {query}") for coll_name in self.collections: try: coll = self.mongo_db.get_collection(coll_name) @@ -236,7 +236,8 @@ class FanhaoSearchPlugin(MessagePluginInterface): # 参数检查 parts = content.split(" ") if len(parts) < 2: - await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}", sender) + await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}", + sender) return False, "命令格式错误" if roomid and gbm.get_group_permission(roomid, self.feature) == PermissionStatus.DISABLED: @@ -248,7 +249,8 @@ class FanhaoSearchPlugin(MessagePluginInterface): f"[{self.name}] 收到查询 command={command} raw='{raw_code}' normalized='{user_code}' db={self.mongo_db_name} collections={self.collections}" ) if not user_code: - await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}", sender) + await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}", + sender) return False, "命令格式错误" try: @@ -269,5 +271,3 @@ class FanhaoSearchPlugin(MessagePluginInterface): def get_plugin(): return FanhaoSearchPlugin() - -