Someone here trying to be nice
20 jun, 15:38
Support channel for Trashcore projects
Mostrar mΓ‘sconst axios = require('axios');
const play3 = {
command: ['play3'],
desc: 'Search and download YouTube audio',
category: 'Downloader',
usage: '.play3 <song name>',
run: async ({ trashcore, m, args, xreply, chat }) => {
try {
const query = args.join(' ');
if (!query) {
return xreply('π΅ Please provide a song name\nExample: .play3 Faded Alan Walker');
}
await xreply('π΅ Searching and downloading audio...\nPowered by Trashcore');
const { data } = await axios.get(
`https://api.drexapp.space/downloader/ytplayv2?q=${encodeURIComponent(query)}`
);
if (!data?.status || !data?.result) {
return xreply('β Failed to fetch song.');
}
const res = data.result;
const caption = `ββββγ π΅ PLAY 3 γβββ⬣
β πΆ *Title:* ${res.title}
β π΅ *Format:* ${res.format || 'MP3'}
β π *Source:* YouTube
β°ββββββββββββββββ⬣`;
await trashcore.sendMessage(chat, {
image: { url: res.thumbnail },
caption
}, { quoted: m });
await trashcore.sendMessage(chat, {
audio: { url: res.downloadUrl },
mimetype: 'audio/mpeg',
fileName: `${res.title}.mp3`
}, { quoted: m });
} catch (err) {
console.error('play3 error:', err);
xreply(`β Error: ${err.message}`);
}
}
};
Command play
YouTube downloader
Powered by Trashcore api