mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: limit number of picture
This commit is contained in:
parent
ef01c37cdf
commit
b5dd59966b
1 changed files with 4 additions and 0 deletions
|
|
@ -48,6 +48,10 @@ export class dalle extends plugin {
|
|||
'256x256': 0.016
|
||||
}
|
||||
num = parseInt(num, 10)
|
||||
if (num > 5) {
|
||||
this.reply('太多啦!你要花光我的余额吗!')
|
||||
return false
|
||||
}
|
||||
await this.reply(`正在为您绘制大小为${size}的${num}张图片,预计消耗${priceMap[size] * num}美元余额,请稍候……`)
|
||||
try {
|
||||
let images = (await createImage(prompt, num, size)).map(image => segment.image(`base64://${image}`))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue