mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
fix: add set_webhook_url call in botmgr for auto callback URL
Pass webhook_full_url to adapters that implement set_webhook_url(), built from api.webhook_prefix config + bot_uuid. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -273,6 +273,12 @@ class PlatformManager:
|
||||
if hasattr(adapter_inst, 'set_bot_uuid'):
|
||||
adapter_inst.set_bot_uuid(bot_entity.uuid)
|
||||
|
||||
# 如果 adapter 支持 set_webhook_url 方法,构建并传递完整的 webhook URL
|
||||
if hasattr(adapter_inst, 'set_webhook_url'):
|
||||
webhook_prefix = self.ap.instance_config.data['api'].get('webhook_prefix', 'http://127.0.0.1:5300')
|
||||
webhook_full_url = f'{webhook_prefix}/bots/{bot_entity.uuid}'
|
||||
adapter_inst.set_webhook_url(webhook_full_url)
|
||||
|
||||
runtime_bot = RuntimeBot(ap=self.ap, bot_entity=bot_entity, adapter=adapter_inst, logger=logger)
|
||||
|
||||
await runtime_bot.initialize()
|
||||
|
||||
Reference in New Issue
Block a user