mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-12-04 19:21:33 +00:00
vip 支持和风天气查询
This commit is contained in:
parent
0f6840f6d1
commit
5476f63566
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,6 +8,7 @@ __pycache__/
|
|||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
|
*/desktop.files.json
|
||||||
|
|
||||||
# Distribution / packaging
|
# Distribution / packaging
|
||||||
.Python
|
.Python
|
||||||
|
@ -342,13 +342,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vip",
|
"name": "vip",
|
||||||
"version": "0.61",
|
"version": "0.62",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "9.8 kb",
|
"size": "9.8 kb",
|
||||||
"supported": true,
|
"supported": true,
|
||||||
"des-short": "vip 捐赠用户功能",
|
"des-short": "vip 捐赠用户功能",
|
||||||
"des": "命令:天气:weather weather_pic \nPixiv:pixiv \n百度:baidu Duckduckgo:duckduckgo\n相似动漫:whatanime。与 weather 插件冲突"
|
"des": "命令:天气:weather weather_pic weather_he\nPixiv:pixiv \n百度:baidu Duckduckgo:duckduckgo\n相似动漫:whatanime。与 weather 插件冲突"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "calculator",
|
"name": "calculator",
|
||||||
|
24
vip.py
24
vip.py
@ -78,7 +78,7 @@ async def weather(context):
|
|||||||
@listener(is_plugin=True, outgoing=True, command=alias_command("weather_pic"),
|
@listener(is_plugin=True, outgoing=True, command=alias_command("weather_pic"),
|
||||||
description="使用彩云天气 api 查询国内实时天气。",
|
description="使用彩云天气 api 查询国内实时天气。",
|
||||||
parameters="<位置>")
|
parameters="<位置>")
|
||||||
async def weather(context):
|
async def weather_pic(context):
|
||||||
await context.edit("获取中 . . .")
|
await context.edit("获取中 . . .")
|
||||||
reply = await context.get_reply_message()
|
reply = await context.get_reply_message()
|
||||||
try:
|
try:
|
||||||
@ -97,6 +97,28 @@ async def weather(context):
|
|||||||
await context.delete()
|
await context.delete()
|
||||||
|
|
||||||
|
|
||||||
|
@listener(is_plugin=True, outgoing=True, command=alias_command("weather_he"),
|
||||||
|
description="使用和风天气 api 查询国内省市实时天气。",
|
||||||
|
parameters="<位置>")
|
||||||
|
async def weather_he(context):
|
||||||
|
await context.edit("获取中 . . .")
|
||||||
|
reply = await context.get_reply_message()
|
||||||
|
try:
|
||||||
|
message = await obtain_message(context)
|
||||||
|
except ValueError:
|
||||||
|
await context.edit("出错了呜呜呜 ~ 无效的参数。")
|
||||||
|
return
|
||||||
|
async with bot.conversation('PagerMaid_Modify_bot') as conversation:
|
||||||
|
await conversation.send_message('/weather_he ' + message)
|
||||||
|
chat_response = await conversation.get_response()
|
||||||
|
await bot.send_read_acknowledge(conversation.chat_id)
|
||||||
|
if reply:
|
||||||
|
await context.respond(chat_response, reply_to=reply)
|
||||||
|
else:
|
||||||
|
await context.respond(chat_response)
|
||||||
|
await context.delete()
|
||||||
|
|
||||||
|
|
||||||
@listener(is_plugin=True, outgoing=True, command=alias_command("pixiv"),
|
@listener(is_plugin=True, outgoing=True, command=alias_command("pixiv"),
|
||||||
description="查询插画信息 (或者回复一条消息)。使用 set [num] 更改镜像源,序号 2 为官方源, 3 为凯露自建源。异步下载需要依赖库 "
|
description="查询插画信息 (或者回复一条消息)。使用 set [num] 更改镜像源,序号 2 为官方源, 3 为凯露自建源。异步下载需要依赖库 "
|
||||||
"aiohttp[speedups] 、 aiofiles",
|
"aiohttp[speedups] 、 aiofiles",
|
||||||
|
Loading…
Reference in New Issue
Block a user