Comando JSON

const path = require('path')

case 'hd': case 'remini':
try {//By: 𖧄 𝐋𝐔𝐂𝐀𝐒 πŒπŽπƒ πƒπŽπŒπˆππ€ 𖧄
if ((isMedia && !info.message.videoMessage) || isQuotedImage) {
let post = isQuotedImage
? JSON.parse(JSON.stringify(info).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo.message.imageMessage
: info.message.imageMessage
reply('😈 _Processando sua imagem! Aguarde..._')
const imagem = await downloadContentFromMessage(post, 'image')
let base64 = Buffer.from([])
for await (const chunk of imagem) {
base64 = Buffer.concat([base64, chunk])
}
const link = await upload(base64)
const response = await fetch(`${zerosite}/api/ia/tohd?link=${link}&apikey=${API_KEY_ZEROTWO}`)
const arrayBuffer = await response.arrayBuffer()
const buffer = Buffer.from(arrayBuffer)
const tempFilePath = path.join(os.tmpdir(), 'processed-image.png')
fs.writeFileSync(tempFilePath, buffer)
await zerotwo.sendMessage(from, { image: { url: tempFilePath } }, { quoted: info })
fs.unlinkSync(tempFilePath)
} else {
reply('😈 _Marque a imagem para eu poder aplicar o filtro do Remini_')
}
} catch (e) {
console.log(e)
return reply("Erro..")
}
break
> Loading... > Processing... > Completed... > Error... > Done...