LiteyukiBot-TriM/liteyuki/plugins/liteyuki_weather/qweather.py

28 lines
545 B
Python
Raw Normal View History

2024-04-11 13:15:29 +08:00
import nonebot
2024-04-10 23:47:10 +08:00
from nonebot import require
2024-04-11 13:15:29 +08:00
from liteyuki.utils.config import get_config
from liteyuki.utils.ly_typing import T_Bot
2024-04-10 23:47:10 +08:00
require("nonebot_plugin_alconna")
2024-04-11 13:15:29 +08:00
from nonebot_plugin_alconna import on_alconna, Alconna, Args, Arparma, MultiVar
2024-04-10 23:47:10 +08:00
@on_alconna(
aliases={"天气"},
command=Alconna(
"weather",
2024-04-11 13:15:29 +08:00
Args["keywords", MultiVar(str), []],
2024-04-10 23:47:10 +08:00
),
).handle()
2024-04-11 13:15:29 +08:00
async def _(bot: T_Bot, result: Arparma):
"""
天气查询
Args:
bot:
Returns:
"""
print("AAA", result, result.main_args)