2024-11-23 21:21:19 +08:00
|
|
|
|
import os
|
|
|
|
|
from zhDateTime import DateTime
|
2024-11-30 03:40:10 +08:00
|
|
|
|
|
|
|
|
|
|
2024-11-23 21:21:19 +08:00
|
|
|
|
async def get_weather(location: str):
|
|
|
|
|
return f"{location}的温度是114514℃。"
|
2024-11-30 03:40:10 +08:00
|
|
|
|
|
|
|
|
|
|
2024-11-23 21:21:19 +08:00
|
|
|
|
async def get_current_env():
|
|
|
|
|
ver = os.popen("uname -a").read()
|
|
|
|
|
return str(ver)
|
|
|
|
|
|
2024-11-30 03:40:10 +08:00
|
|
|
|
|
2024-11-23 21:21:19 +08:00
|
|
|
|
async def get_current_time():
|
2024-11-30 03:40:10 +08:00
|
|
|
|
current_time = DateTime.now().strftime("%Y.%m.%d %H:%M:%S")
|
|
|
|
|
current_weekday = DateTime.now().weekday()
|
2024-11-24 14:48:49 +08:00
|
|
|
|
|
|
|
|
|
weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
|
|
|
|
current_weekday_name = weekdays[current_weekday]
|
|
|
|
|
|
2024-11-30 03:40:10 +08:00
|
|
|
|
current_lunar_date = DateTime.now().to_lunar().date_hanzify()[5:]
|
2024-11-24 14:48:49 +08:00
|
|
|
|
time_prompt = f"现在的时间是{current_time},{current_weekday_name},农历{current_lunar_date}。"
|
2024-11-30 03:40:10 +08:00
|
|
|
|
return time_prompt
|