forked from xIKRATOSx/Shizu-Bot-MD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvertidor-tomp3.js
17 lines (17 loc) Β· 1.76 KB
/
convertidor-tomp3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { toAudio } from '../lib/converter.js'
let handler = async (m, { conn, usedPrefix, command }) => {
let q = m.quoted ? m.quoted : m
let mime = (m.quoted ? m.quoted : m.msg).mimetype || ''
if (!/video|audio/.test(mime)) throw `πΉππππππ
π π ππ ππΜπ
ππ π ππππ π
π πππ ππππ πππππππππ ππ πππ
ππ π΄π·3`
let media = await q.download?.()
if (!media && !/video/.test(mime)) throw `π΅π πππ
π π
ππππππππ ππ ππΜπ
ππ, πππππππΜ ππππππππππ`
if (!media && !/audio/.test(mime)) throw `π΅π ππΜ πππππ π
ππππππππ ππ ππππ π
π πππ, πππππππΜ ππππππππππ`
let audio = await toAudio(media, 'mp4')
if (!audio.data && !/audio/.test(mime)) throw `π΅π ππΜ πππππ πππππππππ ππ ππππ π
π πππ π πππ
ππ π΄π·3 π°ππππππΜ π
π πππππ ππΜπ ππππ
π.`
if (!audio.data && !/video/.test(mime)) throw `π΅π ππΜ πππππ πππππππππ ππ ππππ π
π πππ π πππ
ππ π΄π·3 π°ππππππΜ π
π πππππ ππΜπ ππππ
π.`
conn.sendFile(m.chat, audio.data, 'error.mp3', '', m, null, { mimetype: 'audio/mp4' })
}
handler.help = ['tomp3 (reply)']
handler.tags = ['audio']
handler.command = ['tomp3', 'toaudio', 'mp3']
export default handler