mirror of
https://github.com/TriM-Organization/LiteyukiBot-TriM.git
synced 2024-11-28 16:24:51 +08:00
feat: 同步天气api
This commit is contained in:
parent
f9e5742821
commit
58278fa735
0
liteyuki/plugins/liteyuki_weather/qw_api.py
Normal file
0
liteyuki/plugins/liteyuki_weather/qw_api.py
Normal file
@ -1,27 +1,21 @@
|
|||||||
import nonebot
|
|
||||||
from nonebot import require
|
from nonebot import require
|
||||||
|
from jieba import lcut
|
||||||
|
|
||||||
from liteyuki.utils.config import get_config
|
from liteyuki.utils.ly_typing import T_MessageEvent
|
||||||
from liteyuki.utils.ly_typing import T_Bot
|
|
||||||
|
|
||||||
require("nonebot_plugin_alconna")
|
require("nonebot_plugin_alconna")
|
||||||
from nonebot_plugin_alconna import on_alconna, Alconna, Args, Arparma, MultiVar
|
from nonebot_plugin_alconna import on_alconna, Alconna, Subcommand, Args, MultiVar, Arparma
|
||||||
|
|
||||||
|
|
||||||
@on_alconna(
|
@on_alconna(
|
||||||
aliases={"天气"},
|
aliases={"天气"},
|
||||||
command=Alconna(
|
command=Alconna(
|
||||||
"weather",
|
"weather",
|
||||||
Args["keywords", MultiVar(str), []],
|
Args["keywords", MultiVar(str)],
|
||||||
),
|
),
|
||||||
).handle()
|
).handle()
|
||||||
async def _(bot: T_Bot, result: Arparma):
|
async def _(result: Arparma, event: T_MessageEvent):
|
||||||
"""
|
"""await alconna.send("weather", city)"""
|
||||||
天气查询
|
print(result["keywords"])
|
||||||
Args:
|
if len(result["keywords"]) == 0:
|
||||||
bot:
|
pass
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
"""
|
|
||||||
print("AAA", result, result.main_args)
|
|
||||||
|
@ -3,6 +3,7 @@ aiofiles==23.2.1
|
|||||||
colored==2.2.4
|
colored==2.2.4
|
||||||
dash==2.16.1
|
dash==2.16.1
|
||||||
GitPython==3.1.42
|
GitPython==3.1.42
|
||||||
|
jieba==0.42.1
|
||||||
nonebot2[fastapi,httpx,websockets]==2.2.1
|
nonebot2[fastapi,httpx,websockets]==2.2.1
|
||||||
nonebot-plugin-htmlrender==0.3.1
|
nonebot-plugin-htmlrender==0.3.1
|
||||||
nonebot-adapter-onebot==2.4.3
|
nonebot-adapter-onebot==2.4.3
|
||||||
|
Loading…
Reference in New Issue
Block a user