mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 06:32:47 +00:00
parent
f40273d964
commit
db21ca4e37
@ -332,13 +332,13 @@
|
||||
},
|
||||
{
|
||||
"name": "vip",
|
||||
"version": "0.21",
|
||||
"version": "0.22",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "4.0 kb",
|
||||
"supported": true,
|
||||
"des-short": "vip 捐赠用户功能",
|
||||
"des": "命令:天气:weather Pixiv:pixiv。与 weather 插件冲突"
|
||||
"des": "命令:天气:baidu weather Pixiv:pixiv。与 weather 插件冲突"
|
||||
},
|
||||
{
|
||||
"name": "calculator",
|
||||
|
19
vip.py
19
vip.py
@ -4,6 +4,25 @@ from pagermaid import bot
|
||||
from pagermaid.listener import listener
|
||||
from pagermaid.utils import obtain_message
|
||||
|
||||
|
||||
@listener(is_plugin=True, outgoing=True, command="baidu",
|
||||
description="百度搜索",
|
||||
parameters="<query>")
|
||||
async def baidu(context):
|
||||
await context.edit("获取中 . . .")
|
||||
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('/baidu ' + message)
|
||||
chat_response = await conversation.get_response()
|
||||
await bot.send_read_acknowledge(conversation.chat_id)
|
||||
baidu_text = chat_response.text
|
||||
await context.edit(baidu_text)
|
||||
|
||||
|
||||
@listener(is_plugin=True, outgoing=True, command="weather",
|
||||
description="使用彩云天气 api 查询国内实时天气。",
|
||||
parameters="<城市>")
|
||||
|
Loading…
Reference in New Issue
Block a user