mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-22 13:38:43 +00:00
fix(bot_manager): get_bot_instance
This commit is contained in:
+1
-1
@@ -14,6 +14,6 @@ help: | # 插件的帮助信息
|
||||
命令:
|
||||
/群分析 [天数] - 分析群聊活动
|
||||
/分析设置 [操作] - 管理设置(enable/disable/status/test)
|
||||
version: v4.2.0 # 插件版本号。格式:v1.1.1 或者 v1.1
|
||||
version: v4.2.1 # 插件版本号。格式:v1.1.1 或者 v1.1
|
||||
author: SXP-Simon # 作者
|
||||
repo: https://github.com/SXP-Simon/astrbot-qq-group-daily-analysis # 插件的仓库地址
|
||||
|
||||
@@ -52,18 +52,6 @@ class BotManager:
|
||||
if instance:
|
||||
return instance
|
||||
|
||||
# 如果指定的平台不存在,记录警告并尝试回退
|
||||
if self._bot_instances:
|
||||
first_platform = list(self._bot_instances.keys())[0]
|
||||
logger.warning(
|
||||
f"平台 '{platform_id}' 不存在,回退到第一个可用平台 '{first_platform}'"
|
||||
)
|
||||
return self._bot_instances[first_platform]
|
||||
|
||||
# 没有任何平台可用
|
||||
logger.error(f"平台 '{platform_id}' 不存在,且没有任何可用的bot实例")
|
||||
return None
|
||||
|
||||
# 没有指定平台ID,返回第一个可用的实例
|
||||
if self._bot_instances:
|
||||
first_platform = list(self._bot_instances.keys())[0]
|
||||
|
||||
Reference in New Issue
Block a user