forked from xIKRATOSx/Shizu-Bot-MD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdownloader-soundcloud.js
20 lines (20 loc) Β· 1.58 KB
/
downloader-soundcloud.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import fetch from 'node-fetch'
let handler = async(m, { conn, text }) => {
if (!text) throw `*[βπππ
πβ] πΈπ½πΆππ΄ππ΄ π΄π» π½πΎπΌπ±ππ΄ π³π΄ π°π»πΆππ½π° π²π°π½π²πΈπΎπ½ π° π±πππ²π°π*`
try {
let res = await fetch(`https://hadi-api.herokuapp.com/api/soundcloud/play?query=${text}`)
let json = await res.json()
let shortUrl = await (await fetch(`https://tinyurl.com/api-create.php?url=${json.result.download}`)).text()
let soundcloudt = `βββββ¬ ππππππππππ βββββΎβ
β¬
ββ£β¨ *ππΈπππ»πΎ:* ${json.result.title}
β΄
β¬
ββ£π *πππ» π³πΈππ΄π²ππΎ:* ${shortUrl}\nβ΄\n\n*- π΄πππππππ ππππππ...*\n\n_οΉ«α΄Κα΄ α΄Κsα΄Ιͺα΄ οΉ£ Κα΄α΄_`
conn.sendFile(m.chat, json.result.thumbnail, '', soundcloudt, m)
conn.sendFile(m.chat, json.result.download, 'error.mp3', null, m, false, { mimetype: 'audio/mp4' })
} catch (e) {
throw '*[βπππ
πβ] π΄πππΎπ, π½πΎ ππ΄ π»πΎπΆππΎ π±πππ²π°π π»π° π²π°π½π²πΈπΎπ½ πΎ π»π° πΏπ°πΆπΈπ½π° π³π΄ π°πππ³π° πΏπ°ππ° π±πππ²π°π π»π° π²π°π½π²πΈπΎπ½ π΄πππ° π²π°πΈπ³π°, πΏπΎπ π΅π°π
πΎπ π
ππ΄π»π
π° π° πΈπ½ππ΄ππ½ππ°ππ»πΎ πΌπ°π ππ°ππ³π΄*'
}}
handler.command = /^(soundcloud|cover)$/i
export default handler