fix: resolve dify init and douyu session errors

This commit is contained in:
liuwei
2026-04-08 13:57:57 +08:00
parent 480ebee8c7
commit 1ab0f61e2f
2 changed files with 7 additions and 5 deletions

View File

@@ -98,6 +98,8 @@ class DifyPlugin(MessagePluginInterface):
self._commands = dify_config.get("commands", ["ai", "dify", "聊天", "AI"])
self.command_format = dify_config.get("command-tip", "聊天 请求内容")
self.enable = dify_config.get("enable", True)
raw_api_key = dify_config.get("api-key", "")
raw_base_url = dify_config.get("base-url", "")
self.price = dify_config.get("price", 0)
self.admin_ignore = dify_config.get("admin_ignore", False)
self.whitelist_ignore = dify_config.get("whitelist_ignore", False)
@@ -108,8 +110,8 @@ class DifyPlugin(MessagePluginInterface):
"backend": dify_config.get("backend", ""),
"provider": "dify",
"mode": "workflow",
"api-key": self.api_key,
"base-url": self.base_url,
"api-key": raw_api_key,
"base-url": raw_base_url,
"endpoint": "workflows/run",
"response_mode": "blocking",
"request_timeout": 40,

View File

@@ -666,11 +666,11 @@ class DouyuPlugin(MessagePluginInterface):
continue
if prev_live is True and curr_live is True and room_id not in self._danmu_recorders:
try:
session = self._open_or_resume_session(room_id, nickname, room_name)
if session:
room_session = self._open_or_resume_session(room_id, nickname, room_name)
if room_session:
logger.info(
f"检测到持续直播状态,续接斗鱼直播会话({room_id}): "
f"session={session.get('session_id')}"
f"session={room_session.get('session_id')}"
)
logger.info(f"检测到持续直播状态,补偿启动斗鱼弹幕记录({room_id})")
self._start_danmu_record(room_id)