app/liteyuki/plugins/liteyuki_weather/qweather.py

21 lines
518 B
Python
Raw Normal View History

2024-04-10 23:47:10 +08:00
from nonebot import require
from liteyuki.utils.base.ly_typing import T_MessageEvent
2024-04-11 13:15:29 +08:00
2024-04-10 23:47:10 +08:00
require("nonebot_plugin_alconna")
from nonebot_plugin_alconna import on_alconna, Alconna, Args, MultiVar, Arparma
2024-04-10 23:47:10 +08:00
@on_alconna(
aliases={"天气"},
command=Alconna(
"weather",
2024-04-11 14:41:46 +08:00
Args["keywords", MultiVar(str)],
2024-04-10 23:47:10 +08:00
),
).handle()
2024-04-11 14:41:46 +08:00
async def _(result: Arparma, event: T_MessageEvent):
"""await alconna.send("weather", city)"""
print(result["keywords"])
if len(result["keywords"]) == 0:
pass