From 60681470e674753615277b5040a4cfb5b36f353e Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 14 Feb 2022 00:01:51 +0800 Subject: [PATCH] =?UTF-8?q?vip=20=E6=94=AF=E6=8C=81=20=E5=BD=A9=E4=BA=91?= =?UTF-8?q?=E3=80=81deepl=20=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 6 +++--- vip.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/list.json b/list.json index 52ed4db..4c4f08f 100644 --- a/list.json +++ b/list.json @@ -322,13 +322,13 @@ }, { "name": "vip", - "version": "0.714", + "version": "0.72", "section": "chat", "maintainer": "xtaodada", - "size": "11.6 kb", + "size": "14.4 kb", "supported": true, "des-short": "vip 捐赠用户功能", - "des": "命令:天气:weather weather_pic weather_he\nPixiv:pixiv \n百度:baidu Duckduckgo:duckduckgo\n相似动漫:whatanime\n文本转语音:tts_nan tts_nv tts_tw tts_ne tts_en。与 weather 插件冲突" + "des": "命令:天气:weather weather_pic weather_he\nPixiv:pixiv \n百度:baidu Duckduckgo:duckduckgo\n彩云翻译:caiyun Deepl 翻译:deepl\n相似动漫:whatanime\n文本转语音:tts_nan tts_nv tts_tw tts_ne tts_en。与 weather 插件冲突" }, { "name": "calculator", diff --git a/vip.py b/vip.py index 9aca05f..584a32e 100644 --- a/vip.py +++ b/vip.py @@ -58,6 +58,41 @@ async def baidu(context): await context.edit(baidu_text) +@listener(is_plugin=True, outgoing=True, command=alias_command("caiyun"), + description="彩云翻译", + parameters="") +async def caiyun_translate(context): + await context.edit("获取中 . . .") + try: + message = await obtain_message(context) + except ValueError: + return await context.edit("出错了呜呜呜 ~ 无效的参数。") + async with bot.conversation('PagerMaid_Modify_bot') as conversation: + await conversation.send_message('/translate ' + message) + chat_response = await conversation.get_response() + await bot.send_read_acknowledge(conversation.chat_id) + caiyun_text = chat_response.text + await context.edit(caiyun_text) + + +@listener(is_plugin=True, outgoing=True, command=alias_command("deepl"), + description="Deepl 翻译", + parameters="") +async def deepl_translate(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('/deepl ' + message) + chat_response = await conversation.get_response() + await bot.send_read_acknowledge(conversation.chat_id) + deepl_text = chat_response.text + await context.edit(deepl_text) + + @listener(is_plugin=True, outgoing=True, command=alias_command("weather"), description="使用彩云天气 api 查询国内实时天气。", parameters="<位置>")