fix(多适配器支持): 处理 Bot 实例与平台 ID

This commit is contained in:
SXP-Simon
2025-11-18 14:38:52 +08:00
committed by Helian Nuits
parent c5ca2a8393
commit 453483fb5b
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ class MessageHandler:
return None return None
async def fetch_group_messages( async def fetch_group_messages(
self, bot_instance, group_id: str, days: int self, bot_instance, group_id: str, days: int, platform_id: str = None
) -> List[Dict]: ) -> List[Dict]:
"""获取群聊消息记录""" """获取群聊消息记录"""
try: try:
+4 -4
View File
@@ -79,12 +79,12 @@ class AutoScheduler:
logger.warning(f"使用默认平台: {first_platform}") logger.warning(f"使用默认平台: {first_platform}")
return first_platform return first_platform
# 回退到默认值 # 没有任何bot实例,返回None
logger.warning(f"⚠️ 没有注册的bot实例,使用默认平台 'default'") logger.error(f" 没有注册的bot实例")
return "default" return None
except Exception as e: except Exception as e:
logger.error(f"❌ 获取平台ID失败: {e}") logger.error(f"❌ 获取平台ID失败: {e}")
return "default" return None
async def start_scheduler(self): async def start_scheduler(self):
"""启动定时任务调度器""" """启动定时任务调度器"""