Skip to content

Commit

Permalink
Create sticker-tovideo.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzoy committed Nov 19, 2022
1 parent 2072536 commit b02c242
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions plugins/sticker-tovideo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { webp2mp4 } from '../lib/webp2mp4.js'
let handler = async (m, { conn, usedPrefix, command }) => {
const notStickerMessage = `Reply sticker with command *${usedPrefix + command}*`
if (!m.quoted) throw notStickerMessage
const q = m.quoted || m
let mime = q.mediaType || ''
if (!/sticker/.test(mime)) throw notStickerMessage
let media = await q.download()
let out = await webp2mp4(media).catch(_ => null) || Buffer.alloc(0)
await conn.sendFile(m.chat, out, 'out.mp4', '*DONE*', m)
}
handler.help = ['tovideo (reply)','tomp4 (reply)']
handler.tags = ['sticker']
handler.command = ['tovideo','tomp4']
handler.limit = true
export default handler

0 comments on commit b02c242

Please sign in to comment.