case 'toanime': {
if (!isVip && !isGroup) return reply(enviar.msg.pvnotvip)
if ((isMedia && !info.message.videoMessage) || isQuotedImage) {
const boij = isQuotedImage
? JSON.parse(JSON.stringify(info).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo.message.imageMessage
: info.message.imageMessage
const owgi = await getFileBuffer(boij, 'image')
const link = await upload(owgi)
const contextInfo = {
mentionedJid: [info.key.participant || info.key.remoteJid],
externalAdReply: {
title: 'π¨ ZeroTwo APIs β ToAnime',
body: `ποΈ Convertendo para estilo Anime...`,
thumbnailUrl: link,
sourceUrl: 'https://whatsapp.com/channel/0029Vb69bDnAe5VmzSMwBH11',
mediaType: 1,
renderLargerThumbnail: false,
}
}
await zerotwo.sendMessage(from, { text: `β³ *Processando sua imagem...*\nβββββββββββββββββββ\nβ ποΈ Style: *Anime (Ghibli)*\nβ π€ @${(info.key.participant || info.key.remoteJid).split('@')[0]}\nβ β±οΈ Aguarde, isso pode demorar...\nβ°ββββββββββββββββββ`, contextInfo, mentions: [info.key.participant || info.key.remoteJid]}, { quoted: info })
try {
const apiUrl = `${zerosite}/api/ia/toanime?url=${encodeURIComponent(link)}&apikey=${API_KEY_ZEROTWO}`
const response = await fetch(apiUrl)
if (!response.ok) throw new Error(`Erro na API: ${response.status}`)
const imageBuffer = Buffer.from(await response.arrayBuffer())
await zerotwo.sendMessage(from, { image: imageBuffer, caption: `β
*ConversΓ£o concluΓda!*\nβββββββββββββββββββ\nβ ποΈ Style: *Anime (Ghibli)*\nβ π€ @${(info.key.participant || info.key.remoteJid).split('@')[0]}\nβ°ββββββββββββββββββ`, contextInfo, mentions: [info.key.participant || info.key.remoteJid]}, { quoted: info })
} catch (e) {
console.error(e)
reply(`β *Erro ao converter imagem*\n> ${e.message}`)
}
} else {
reply(`π *${prefix}toanime β Como usar:*\nβββββββββββββββββββ\nβ Marque ou responda uma imagem e envie:\nβ *${prefix}toanime*\nβ A imagem serΓ‘ convertida para\nβ o estilo *Anime (Ghibli)*\nβ°ββββββββββββββββββ`)
}
}
break