mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
修复bing绘图第三方调用错误
This commit is contained in:
parent
fed2fd8dd4
commit
7c45b050ca
1 changed files with 5 additions and 2 deletions
|
|
@ -1669,6 +1669,7 @@ export class chatgpt extends plugin {
|
|||
// 调用第三方API进行绘图
|
||||
const drawOption = {
|
||||
method: 'POST',
|
||||
headers: {'content-type': 'application/json'},
|
||||
body: JSON.stringify({
|
||||
prompt: response.details.imageTag,
|
||||
width: 512,
|
||||
|
|
@ -1677,11 +1678,13 @@ export class chatgpt extends plugin {
|
|||
}
|
||||
const drawData = await fetch(Config.bingDrawApi, drawOption)
|
||||
if (drawData.ok) {
|
||||
let draw = await cacheres.json()
|
||||
if (draw.images) {
|
||||
let draw = await drawData.json()
|
||||
if (draw.images?.length > 0) {
|
||||
for(let image of draw.images) {
|
||||
this.reply(segment.image(`base64://${image}`), true)
|
||||
}
|
||||
} else {
|
||||
await e.reply('绘图失败:未产生图片')
|
||||
}
|
||||
} else {
|
||||
await e.reply('绘图失败:第三方绘图服务器错误')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue