Compare commits

..

3 Commits

Author SHA1 Message Date
Soulter fdabfef6a7 update: version 2024-03-13 21:28:18 +08:00
Soulter 6c5718f134 fix: 修复画图的报错 2024-03-13 21:27:48 +08:00
Soulter edfde51434 fix: 修复频道平台下未找到平台 qqchan 的实例的错误 2024-03-13 19:53:36 +08:00
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ frequency_time = 60
frequency_count = 10
# 版本
version = '3.1.7'
version = '3.1.9'
# 语言模型
REV_CHATGPT = 'rev_chatgpt'
@@ -244,7 +244,7 @@ def run_qqchan_bot(cfg: dict, global_object: GlobalObject):
try:
from model.platform.qq_official import QQOfficial
qqchannel_bot = QQOfficial(cfg=cfg, message_handler=oper_msg, global_object=global_object)
global_object.platforms.append(RegisteredPlatform(platform_name="qq_official", platform_instance=qqchannel_bot, origin="internal"))
global_object.platforms.append(RegisteredPlatform(platform_name="qqchan", platform_instance=qqchannel_bot, origin="internal"))
qqchannel_bot.run()
except BaseException as e:
logger.log("启动QQ频道机器人时出现错误, 原因如下: " + str(e), gu.LEVEL_CRITICAL, tag="QQ频道")
+3 -3
View File
@@ -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):