From 17b6c63fb9460f0cbd5335be873a8d6fd69ac609 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Mon, 19 Dec 2022 03:06:48 +0800 Subject: [PATCH] fix: image create prefix match bug --- bot/openai/open_ai_bot.py | 2 -- channel/wechat/wechat_channel.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bot/openai/open_ai_bot.py b/bot/openai/open_ai_bot.py index fc518c3..a8c14c7 100644 --- a/bot/openai/open_ai_bot.py +++ b/bot/openai/open_ai_bot.py @@ -53,7 +53,6 @@ class OpenAIBot(Bot): return image_url def edit_img(self, query, src_img): - openai.api_key = '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' try: response = openai.Image.create_edit( image=open(src_img, 'rb'), @@ -70,7 +69,6 @@ class OpenAIBot(Bot): return image_url def migration_img(self, query, src_img): - openai.api_key = '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' try: response = openai.Image.create_variation( diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index 37544ea..5da3681 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -52,7 +52,7 @@ class WechatChannel(Channel): if len(str_list) == 2: content = str_list[1].strip() - img_match_prefix = self.check_prefix(content, ["画图"]) + img_match_prefix = self.check_prefix(content, conf().get('image_create_prefix')) if img_match_prefix: content = content.split(img_match_prefix, 1)[1].strip() thead_pool.submit(self._do_send_img, content, from_user_id)