From fa4df0b5f300655680adc653ba0e86f834c17fd1 Mon Sep 17 00:00:00 2001 From: L1ngg <2157878170@qq.com> Date: Tue, 3 Mar 2026 15:15:20 +0800 Subject: [PATCH] fix(core): correctly parse DEMO_MODE as boolean from env var. (#5676) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(core): correctly parse DEMO_MODE as boolean from env var. * Update astrbot/core/__init__.py fix(core): 添加.strip()以确保代码健壮性 Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- astrbot/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/__init__.py b/astrbot/core/__init__.py index 6400d6fa4..5c015e96e 100644 --- a/astrbot/core/__init__.py +++ b/astrbot/core/__init__.py @@ -14,7 +14,7 @@ from .utils.astrbot_path import get_astrbot_data_path # 初始化数据存储文件夹 os.makedirs(get_astrbot_data_path(), exist_ok=True) -DEMO_MODE = os.getenv("DEMO_MODE", False) +DEMO_MODE = os.getenv("DEMO_MODE", "False").strip().lower() in ("true", "1", "t") astrbot_config = AstrBotConfig() t2i_base_url = astrbot_config.get("t2i_endpoint", "https://t2i.soulter.top/text2img")