-
-
Save kajju027/2b468496dba73d000d836138785e3663 to your computer and use it in GitHub Desktop.
🎶 No description? 😅 Ohkay ohkay... Fast response powered by David Cyril’s API ⚡️ — Made by Corex with 💙
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Create by Corex with 💙 | |
| //github.com/Corex24 | |
| //t.me/corex2410 | |
| const { bot } = require('../lib/') | |
| const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args)) | |
| bot( | |
| { | |
| pattern: 'sonu ?(.*)', | |
| type: 'music', | |
| desc: 'Play a song from a search term', | |
| }, | |
| async (message, match) => { | |
| if (!match) return await message.send('❌ Please enter a song name.\nExample: .Sonu Sanam Teri Kasam') | |
| const api = `https://apis.davidcyriltech.my.id/play?query=${encodeURIComponent(match)}` | |
| try { | |
| const res = await fetch(api) | |
| const data = await res.json() | |
| if (data.status && data.result && data.result.download_url) { | |
| // নতুন caption স্টাইল | |
| const caption = | |
| `☘️ Tɪᴛʟᴇ : ${data.result.title || 'Unknown'} | |
| ❒ ⏱️ Dᴜʀᴀᴛɪᴏɴ : ${data.result.duration || '-'} | |
| ❒ 🎭 𝚅ɪᴇᴡ : ${data.result.views || '-'} | |
| *ᴜꜱᴇ ʜᴇᴀᴅᴘʜᴏɴᴇꜱ ꜰᴏʀ ʙᴇꜱᴛ ᴇxᴘᴇʀɪᴇɴᴄᴇ...☊* | |
| > *Ꭾᴏᴡᴇʀᴇᴅ Ᏼʏ ꕶᴀʏᴀɴ ᴏᴀɪ *` | |
| // থাম্বনেইল সহ caption পাঠানো | |
| if (data.result.thumbnail) { | |
| await message.sendFromUrl( | |
| data.result.thumbnail, | |
| { caption: caption }, | |
| 'image' | |
| ) | |
| } | |
| // অডিও পাঠানো | |
| await message.sendFromUrl( | |
| data.result.download_url, | |
| { mimetype: 'audio/mp4', ptt: false }, | |
| 'audio' | |
| ) | |
| } else { | |
| await message.send('❌ No Song Found & Tera Bot ve Chu**d gaya') | |
| } | |
| } catch (e) { | |
| console.error(e) | |
| await message.send('❌ An error occurred while processing your request.') | |
| } | |
| } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment