diff --git a/list.json b/list.json index 1dec051..c4eab8b 100644 --- a/list.json +++ b/list.json @@ -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", diff --git a/vip.py b/vip.py index 7d65065..7f8fe1c 100644 --- a/vip.py +++ b/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="") +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="<城市>")