diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ecab6bd2..2c38647e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: autoupdate_commit_msg: ":balloon: pre-commit autoupdate" repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.9 + rev: v0.9.10 hooks: - id: ruff - id: ruff-format diff --git a/compose.yml b/compose.yml index 75380370c..805d30c11 100644 --- a/compose.yml +++ b/compose.yml @@ -12,3 +12,5 @@ services: - "11451:11451" # optional, gewechat default port volumes: - ./data:/AstrBot/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro diff --git a/packages/astrbot/main.py b/packages/astrbot/main.py index 9549fcd38..c8ed2564d 100644 --- a/packages/astrbot/main.py +++ b/packages/astrbot/main.py @@ -1101,8 +1101,9 @@ UID: {user_id} 此 ID 可用于设置管理员。 req.prompt = user_info + req.prompt if self.enable_datetime: + # Including timezone current_time = ( - datetime.datetime.now().astimezone().strftime("%Y-%m-%d %H:%M") + datetime.datetime.now().astimezone().strftime("%Y-%m-%d %H:%M (%Z)") ) req.system_prompt += f"\nCurrent datetime: {current_time}\n"