Merge remote-tracking branch 'origin/master'

This commit is contained in:
beat4ocean
2025-03-11 15:48:44 +08:00
3 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"