mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-22 02:07:13 +00:00
feat: fix bot id
This commit is contained in:
@@ -71,7 +71,7 @@ class WecomBotClient:
|
|||||||
nonce = unquote(request.args.get("nonce", ""))
|
nonce = unquote(request.args.get("nonce", ""))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
timeout = 3.2
|
timeout = 3
|
||||||
interval = 0.1
|
interval = 0.1
|
||||||
start_time = time.monotonic()
|
start_time = time.monotonic()
|
||||||
encrypted_json = await request.get_json()
|
encrypted_json = await request.get_json()
|
||||||
@@ -155,7 +155,7 @@ class WecomBotClient:
|
|||||||
await asyncio.sleep(interval)
|
await asyncio.sleep(interval)
|
||||||
|
|
||||||
if self.msg_id_map.get(message_data['msgid'], 1) == 3:
|
if self.msg_id_map.get(message_data['msgid'], 1) == 3:
|
||||||
print('请求失效:暂不支持智能机器人超过10秒的请求,如有需求,请联系 LangBot 团队。')
|
print('请求失效:暂不支持智能机器人超过7秒的请求,如有需求,请联系 LangBot 团队。')
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -98,14 +98,14 @@ class WecomBotAdapter(adapter.MessagePlatformAdapter):
|
|||||||
missing_keys = [key for key in required_keys if key not in config]
|
missing_keys = [key for key in required_keys if key not in config]
|
||||||
if missing_keys:
|
if missing_keys:
|
||||||
raise ParamNotEnoughError('缺少相关配置项,请查看文档或联系管理员')
|
raise ParamNotEnoughError('缺少相关配置项,请查看文档或联系管理员')
|
||||||
self.bot_account_id = self.config['BotId']
|
|
||||||
self.bot = WecomBotClient(
|
self.bot = WecomBotClient(
|
||||||
Token=self.config['Token'],
|
Token=self.config['Token'],
|
||||||
EnCodingAESKey=self.config['EncodingAESKey'],
|
EnCodingAESKey=self.config['EncodingAESKey'],
|
||||||
Corpid=self.config['Corpid'],
|
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):
|
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)
|
content = await self.message_converter.yiri2target(message)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ spec:
|
|||||||
en_US: BotId
|
en_US: BotId
|
||||||
zh_Hans: 机器人ID
|
zh_Hans: 机器人ID
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
execution:
|
execution:
|
||||||
python:
|
python:
|
||||||
|
|||||||
Reference in New Issue
Block a user