Skip to content

Commit

Permalink
Fix ran undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Kry9toN committed Jan 22, 2021
1 parent 6115e05 commit 48bcd3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions command/sticker.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module.exports = {
if (!client.isPmium && !client.isOwner) return client.reply(pesan.error.premium)
const encmedia = client.isQuotedImage ? JSON.parse(JSON.stringify(chat).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : chat
const media = await client.downloadAndSaveMediaMessage(encmedia)
ranw = getRandom('.webp')
await ffmpeg(`./${media}`)
.on('start', function (cmd) {
console.log('[SERVER] Started :', cmd)
Expand All @@ -98,11 +99,11 @@ module.exports = {
console.log('[SERVER] Berhasil membuat sticker')
fs.unlinkSync(media)
client.sendMessage(client.from, fs.readFileSync(ran), MessageType.sticker, { quoted: chat })
fs.unlinkSync(ran)
fs.unlinkSync(ranw)
})
.addOutputOptions(['-vcodec', 'libwebp', '-vf', `scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=${args[0]}@0.0, split [a][b]; [a] palettegen=reserve_transparent=off; [b][p] paletteuse`])
.toFormat('webp')
.save(ran)
.save(ranw)
} else {
client.reply('Kirim gambar dengan caption !sticker atau tag gambar yang sudah dikirim')
}
Expand Down

0 comments on commit 48bcd3d

Please sign in to comment.