This repository has been archived on 2026-01-13. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Lunaris/music_sources/spotify.js
Myx d9408907dd Create Discord Music Bot
Can play and queue, can play music in multiple servers at once
2023-06-21 04:24:58 +02:00

15 lines
416 B
JavaScript

const playdl = require('play-dl');
async function getStream(query) {
const trackInfo = await playdl.spotify(query);
let searched = await play.search(`${trackInfo.name}`, {
limit: 1
}) // This will search the found track on youtube.
let stream = await play.stream(searched[0].url) // This will create stream from the above search
return stream;
}
module.exports.getStream = getStream;