From 72ec4b77d6c9605ada6f06ad9d1d62acb3e43a24 Mon Sep 17 00:00:00 2001 From: wangcham Date: Sat, 6 Sep 2025 05:41:02 +0000 Subject: [PATCH] feat: fix bot id --- libs/wecom_ai_bot_api/api.py | 4 ++-- pkg/platform/sources/wecombot.py | 6 +++--- pkg/platform/sources/wecombot.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/wecom_ai_bot_api/api.py b/libs/wecom_ai_bot_api/api.py index e6abc4ac..a30b960b 100644 --- a/libs/wecom_ai_bot_api/api.py +++ b/libs/wecom_ai_bot_api/api.py @@ -71,7 +71,7 @@ class WecomBotClient: nonce = unquote(request.args.get("nonce", "")) try: - timeout = 3.2 + timeout = 3 interval = 0.1 start_time = time.monotonic() encrypted_json = await request.get_json() @@ -155,7 +155,7 @@ class WecomBotClient: await asyncio.sleep(interval) if self.msg_id_map.get(message_data['msgid'], 1) == 3: - print('请求失效:暂不支持智能机器人超过10秒的请求,如有需求,请联系 LangBot 团队。') + print('请求失效:暂不支持智能机器人超过7秒的请求,如有需求,请联系 LangBot 团队。') return '' except Exception as e: diff --git a/pkg/platform/sources/wecombot.py b/pkg/platform/sources/wecombot.py index b2380120..e8e8592c 100644 --- a/pkg/platform/sources/wecombot.py +++ b/pkg/platform/sources/wecombot.py @@ -98,14 +98,14 @@ class WecomBotAdapter(adapter.MessagePlatformAdapter): missing_keys = [key for key in required_keys if key not in config] if missing_keys: raise ParamNotEnoughError('缺少相关配置项,请查看文档或联系管理员') - self.bot_account_id = self.config['BotId'] self.bot = WecomBotClient( Token=self.config['Token'], EnCodingAESKey=self.config['EncodingAESKey'], Corpid=self.config['Corpid'], - logger=self.logger + logger=self.logger, ) - + self.bot_account_id = self.config['BotId'] + async def reply_message(self, message_source:platform_events.MessageEvent, message:platform_message.MessageChain,quote_origin: bool = False): content = await self.message_converter.yiri2target(message) diff --git a/pkg/platform/sources/wecombot.yaml b/pkg/platform/sources/wecombot.yaml index 766bd904..960a0417 100644 --- a/pkg/platform/sources/wecombot.yaml +++ b/pkg/platform/sources/wecombot.yaml @@ -54,7 +54,7 @@ spec: en_US: BotId zh_Hans: 机器人ID type: string - required: true + required: false default: "" execution: python: