mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 13:47:15 +08:00
fix: image create prefix match bug
This commit is contained in:
@@ -53,7 +53,6 @@ class OpenAIBot(Bot):
|
|||||||
return image_url
|
return image_url
|
||||||
|
|
||||||
def edit_img(self, query, src_img):
|
def edit_img(self, query, src_img):
|
||||||
openai.api_key = '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'
|
|
||||||
try:
|
try:
|
||||||
response = openai.Image.create_edit(
|
response = openai.Image.create_edit(
|
||||||
image=open(src_img, 'rb'),
|
image=open(src_img, 'rb'),
|
||||||
@@ -70,7 +69,6 @@ class OpenAIBot(Bot):
|
|||||||
return image_url
|
return image_url
|
||||||
|
|
||||||
def migration_img(self, query, src_img):
|
def migration_img(self, query, src_img):
|
||||||
openai.api_key = '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'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = openai.Image.create_variation(
|
response = openai.Image.create_variation(
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class WechatChannel(Channel):
|
|||||||
if len(str_list) == 2:
|
if len(str_list) == 2:
|
||||||
content = str_list[1].strip()
|
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:
|
if img_match_prefix:
|
||||||
content = content.split(img_match_prefix, 1)[1].strip()
|
content = content.split(img_match_prefix, 1)[1].strip()
|
||||||
thead_pool.submit(self._do_send_img, content, from_user_id)
|
thead_pool.submit(self._do_send_img, content, from_user_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user