mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-01 03:59:51 +00:00
✨ 添加天气查询插件,更新文档以说明插件功能和安装步骤
This commit is contained in:
13
nonebot_plugin_marshoai/plugins/weather_demo.py
Normal file
13
nonebot_plugin_marshoai/plugins/weather_demo.py
Normal file
@ -0,0 +1,13 @@
|
||||
from nonebot_plugin_marshoai.plugin import PluginMetadata, String, on_function_call
|
||||
|
||||
metadata = PluginMetadata(
|
||||
name="天气查询", author="MarshoAI", description="一个简单的查询天气的插件"
|
||||
)
|
||||
|
||||
|
||||
@on_function_call(description="可以用于查询天气").params(
|
||||
location=String(description="地点")
|
||||
)
|
||||
async def weather(location: str) -> str:
|
||||
# 这里可以调用天气API查询天气,这里只是一个简单的示例
|
||||
return f"{location}的天气是晴天, 温度是25°C"
|
Reference in New Issue
Block a user