mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-27 07:56:19 +00:00
vip 支持 彩云、deepl 翻译
This commit is contained in:
parent
e4e975f7c1
commit
60681470e6
@ -322,13 +322,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vip",
|
"name": "vip",
|
||||||
"version": "0.714",
|
"version": "0.72",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "11.6 kb",
|
"size": "14.4 kb",
|
||||||
"supported": true,
|
"supported": true,
|
||||||
"des-short": "vip 捐赠用户功能",
|
"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",
|
"name": "calculator",
|
||||||
|
35
vip.py
35
vip.py
@ -58,6 +58,41 @@ async def baidu(context):
|
|||||||
await context.edit(baidu_text)
|
await context.edit(baidu_text)
|
||||||
|
|
||||||
|
|
||||||
|
@listener(is_plugin=True, outgoing=True, command=alias_command("caiyun"),
|
||||||
|
description="彩云翻译",
|
||||||
|
parameters="<query>")
|
||||||
|
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="<query>")
|
||||||
|
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"),
|
@listener(is_plugin=True, outgoing=True, command=alias_command("weather"),
|
||||||
description="使用彩云天气 api 查询国内实时天气。",
|
description="使用彩云天气 api 查询国内实时天气。",
|
||||||
parameters="<位置>")
|
parameters="<位置>")
|
||||||
|
Loading…
Reference in New Issue
Block a user