update compose.yml to mount system time and tz
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1098,8 +1098,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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user