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="<位置>")