mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: replace stream with file
This commit is contained in:
parent
eef4254e00
commit
8b2493a4bf
1 changed files with 7 additions and 7 deletions
|
|
@ -343,7 +343,7 @@ ${translateLangLabels}
|
||||||
logger.info('combine ' + e.msg)
|
logger.info('combine ' + e.msg)
|
||||||
let resultFileLoc = `data/chatgpt/emoji/${left}_${right}.jpg`
|
let resultFileLoc = `data/chatgpt/emoji/${left}_${right}.jpg`
|
||||||
if (fs.existsSync(resultFileLoc)) {
|
if (fs.existsSync(resultFileLoc)) {
|
||||||
let image = segment.image(fs.createReadStream(resultFileLoc))
|
let image = segment.image(resultFileLoc)
|
||||||
image.asface = true
|
image.asface = true
|
||||||
await this.reply(image, true)
|
await this.reply(image, true)
|
||||||
return true
|
return true
|
||||||
|
|
@ -370,12 +370,12 @@ ${translateLangLabels}
|
||||||
await this.reply('不支持合成', true)
|
await this.reply('不支持合成', true)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
let response = await fetch(url)
|
// let response = await fetch(url)
|
||||||
const resultBlob = await response.blob()
|
// const resultBlob = await response.blob()
|
||||||
const resultArrayBuffer = await resultBlob.arrayBuffer()
|
// const resultArrayBuffer = await resultBlob.arrayBuffer()
|
||||||
const resultBuffer = Buffer.from(resultArrayBuffer)
|
// const resultBuffer = Buffer.from(resultArrayBuffer)
|
||||||
await fs.writeFileSync(resultFileLoc, resultBuffer)
|
// await fs.writeFileSync(resultFileLoc, resultBuffer)
|
||||||
let image = segment.image(fs.createReadStream(resultFileLoc))
|
let image = segment.image(url)
|
||||||
image.asface = true
|
image.asface = true
|
||||||
await this.reply(image, true)
|
await this.reply(image, true)
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue