冒险任务输出格式优化

This commit is contained in:
2025-10-31 18:01:33 +08:00
parent 156a0e5752
commit ff709eadca
2 changed files with 21 additions and 2 deletions

View File

@@ -232,7 +232,13 @@ class AdventureGame(BaseGame):
# 计算预计完成时间
end_time = current_time + cost_time
end_datetime = datetime.fromtimestamp(end_time)
end_time_str = end_datetime.strftime('%H:%M:%S')
current_datetime = datetime.fromtimestamp(current_time)
# 判断是否跨天:如果完成日期和当前日期不同,或跨年,则显示完整日期时间
if (end_datetime.date() != current_datetime.date() or
end_datetime.year != current_datetime.year):
end_time_str = end_datetime.strftime('%Y-%m-%d %H:%M:%S')
else:
end_time_str = end_datetime.strftime('%H:%M:%S')
cost_time_str = self._format_time(cost_time)
text = f"## ⚡️ 冒险开始\n\n"