Skip to content

模块 nonebot_plugin_marshoai.plugins_test.marshoai_basic


@on_function_call(description='获取当前时间,日期和星期')

async func get_current_time() -> str

说明: 获取当前的时间和日期

源代码在GitHub上查看
python
@on_function_call(description='获取当前时间,日期和星期')
async def get_current_time() -> str:
    current_time = DateTime.now()
    time_prompt = '现在的时间是 {}{}{}。'.format(current_time.strftime('%Y.%m.%d %H:%M:%S'), weekdays[current_time.weekday()], current_time.chinesize.date_hanzify('农历{干支年}{生肖}{月份}{数序日}'))
    return time_prompt

文档完善中,欢迎提出建议或帮助我们完善。