Skip to content

Commit

Permalink
fix error, quotemaker3
Browse files Browse the repository at this point in the history
  • Loading branch information
LoL-Human committed Mar 31, 2021
1 parent b725ac9 commit 8024d5a
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,32 @@ async function starts() {
break

// Creator
case 'quotemaker3':
if ((isMedia && !lol.message.videoMessage || isQuotedImage)) {
if (args.length == 0) return reply(`Example: ${prefix + command} LoL|Human`)
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(lol).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : lol
filePath = await lolhuman.downloadAndSaveMediaMessage(encmedia, filename = getRandom());
file_name = getRandom(".webp")
ini_txt = args.join(" ")
request({
url: `http://api.lolhuman.xyz/api/quotemaker3?apikey=${apikey}`,
method: 'POST',
formData: {
"img": fs.createReadStream(filePath),
"text": ini_txt
},
encoding: "binary"
}, function(error, response, body) {
fs.unlinkSync(filePath)
fs.writeFileSync(file_name, body, "binary")
ini_buff = fs.readFileSync(file_name)
lolhuman.sendMessage(from, ini_buff, image, { quoted: lol })
fs.unlinkSync(file_name)
});
} else {
reply(`Kirim gambar dengan caption ${prefix + command} atau tag gambar yang sudah dikirim`)
}
break
case 'stickerwm':
if ((isMedia && !lol.message.videoMessage || isQuotedImage)) {
if (args.length == 0) return reply(`Example: ${prefix + command} LoL|Human`)
Expand All @@ -1498,7 +1524,7 @@ async function starts() {
fs.unlinkSync(file_name)
});
} else {
reply(`Tag sticker yang sudah dikirim`)
reply(`Kirim gambar dengan caption ${prefix + command} atau tag gambar yang sudah dikirim`)
}
break
case 'sticker':
Expand Down Expand Up @@ -1548,7 +1574,7 @@ async function starts() {
fs.unlinkSync(file_name)
});
} else {
reply(`Kirim gambar dengan caption ${prefix + command} atau tag gambar yang sudah dikirim`)
reply(`Tag sticker yang sudah dikirim`)
}
break
case 'ttp':
Expand Down Expand Up @@ -1764,23 +1790,6 @@ async function starts() {
ini_buffer = await getBuffer(`http://api.lolhuman.xyz/api/random2/${command}?apikey=${apikey}`)
lolhuman.sendMessage(from, ini_buffer, image, { quoted: lol })
break
case 'ngif':
case 'nsfw_neko_gif':
case 'random_hentai_gif':
try {
ranp = getRandom('.gif')
rano = getRandom('.webp')
ini_buffer = `http://api.lolhuman.xyz/api/random2/${command}?apikey=${apikey}`
exec(`wget ${ini_buffer} -O ${ranp} && ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=15 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${rano}`, (err) => {
fs.unlinkSync(ranp)
buff = fs.readFileSync(rano)
lolhuman.sendMessage(from, buff, sticker, { quoted: lol })
fs.unlinkSync(rano)
})
} catch {
throw "Error occured"
}
break

// Textprome //
case 'blackpink':
Expand Down

0 comments on commit 8024d5a

Please sign in to comment.