From 1de86de85f0851b6c9ff14c23eff90f0bc15a1b9 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Thu, 13 Apr 2023 21:35:55 +0800 Subject: [PATCH] =?UTF-8?q?vip=20draw=20AI=20=E7=BB=98=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vip/DES.md | 49 +++++++++++++++++++++++++++++++++++++++++++++---- vip/main.py | 19 +++++++++++++++++++ 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/vip/DES.md b/vip/DES.md index 94c5e6d..a0178c6 100644 --- a/vip/DES.md +++ b/vip/DES.md @@ -1,4 +1,45 @@ -命令:天气:weather weather_pic weather_he -Duckduckgo:duckduckgo -彩云翻译:caiyun -文本转语音:tts_nan tts_nv tts_tw tts_ne tts_en。与 weather 插件冲突 \ No newline at end of file +VIP 相关命令: + +# 天气 + +与 weather 插件冲突 + +## 彩云天气 + +`,weather 北京` + +`,weather_pic 北京` + +## 和风天气 + +`,weather_he 北京` + +# 搜索 + +## Duckduckgo + +`,duckduckgo pagermaid` + +# 翻译 + +## 彩云翻译 + +`,caiyun hello` + +# 文本转语音 + +`,tts_nan 简体男声` + +`,tts_nv 简体女声` + +`,tts_tw 繁体男声` + +`,tts_ne 简体新闻男声` + +`,tts_en 英文男声` + +# AI + +## 画图 + +`,draw two boy` diff --git a/vip/main.py b/vip/main.py index 4de96ed..69a79f9 100644 --- a/vip/main.py +++ b/vip/main.py @@ -124,3 +124,22 @@ async def az_tts_ne(client: Client, message: Message): parameters="[字符串]") async def az_tts_en(client: Client, message: Message): await az_tts(client, message, "en") + + +@listener( + command="draw", + description="使用 AI 进行绘图。", + parameters="prompt" +) +async def draw_photo(client: Client, message: Message): + text = message.obtain_message() + if not text: + return await message.edit("请输入 prompt") + async with client.conversation("PagerMaid_Modify_bot") as conv: + answer: Message = await conv.ask(f"/draw {text}") + await conv.mark_as_read() + await answer.copy( + message.chat.id, + reply_to_message_id=message.reply_to_message_id or message.reply_to_top_message_id + ) + await message.safe_delete()