From 6c5718f134f032e5b4db95afa736e02b2e7d8f45 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Wed, 13 Mar 2024 21:27:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=BB=E5=9B=BE?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/command/openai_official.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/command/openai_official.py b/model/command/openai_official.py index 472e3fd52..3891bb6db 100644 --- a/model/command/openai_official.py +++ b/model/command/openai_official.py @@ -49,7 +49,7 @@ class CommandOpenAIOfficial(Command): elif self.command_start_with(message, "update"): return True, self.update(message, role) elif self.command_start_with(message, "画", "draw"): - return True, self.draw(message) + return True, await self.draw(message) elif self.command_start_with(message, "key"): return True, self.key(message) elif self.command_start_with(message, "switch"): @@ -256,7 +256,7 @@ class CommandOpenAIOfficial(Command): self.personality_str = message return True, f"自定义人格已设置。 \n人格信息: {ps}", "set" - def draw(self, message): + async def draw(self, message): if self.provider is None: return False, "未启用 OpenAI 官方 API", "draw" if message.startswith("/画"): @@ -265,7 +265,7 @@ class CommandOpenAIOfficial(Command): message = message[1:] try: # 画图模式传回3个参数 - img_url = self.provider.image_chat(message) + img_url = await self.provider.image_chat(message) return True, img_url, "draw" except Exception as e: if 'exceeded' in str(e):