const sendStickerFromUrl = async(to, url) => {
try {
var names = Date.now() / 10000
var download = function (uri, filename, callback) {
request.head(uri, function (err, res, body) {
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback)
})
}
download(url, './sticker' + names + '.png', async function () {
console.log('enviando sticker')
let filess = './sticker' + names + '.png'
let asw = './sticker' + names + '.webp'
exec(`ffmpeg -i ${filess} -vcodec libwebp -filter:v fps=fps=15 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 800:800 ${asw}`, (err) => {
let media = fs.readFileSync(asw)
zerotwo.sendMessage(to, {sticker: media}, {sendEphemeral: true, contextInfo: { forwardingScore: 50, isForwarded: true, forwardedNewsletterMessageInfo: {newsletterJid: channel }}, quoted: info}).catch(e => {
return reply("Erro..")
})
DLT_FL(filess)
DLT_FL(asw)
})
})
} catch {
return reply("Erro.. FNC")
}
}
case 'emoji-mix':
case 'emojimix':
case 'emoji2':
var [emj1, emj2] = q.trim().split("+")
if(!q.includes("+")) return reply(`Olá, está faltando o +\nExemplo: ${prefix+command} 👿+😇`)
try {
reply(`❪∘̥⃟⸽⃟𝙼𝚒𝚜𝚝𝚞𝚛𝚊𝚗𝚍𝚘┋${emj1} e ${emj2}┋𝙴𝚖𝚘𝚓𝚒𝚜∘̥⃟৴▸`)
sendStickerFromUrl(from, `${zerosite}/api/emojimix?emoji1=${encodeURI(emj1)}&emoji2=${encodeURI(emj2)}&apikey=`+API_KEY_ZEROTWO)
} catch (e) {
if(JSON.stringify(e).includes(API_KEY_ZEROTWO)) {
return reply("A api caiu ou não foi possivel executar esta ação., espere retornar")
} else {
reply('*Não consegui combinar esses emojis* 🙇🏻♂️')
}
}
break