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/soundcloud.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

13 lines
455 B
JavaScript

const playdl = require('play-dl');
async function getStream(query) {
let songInformation = await playdl.soundcloud(query) // Make sure that url is track url only. For playlist, make some logic.
let stream = await playdl.stream_from_info(songInformation, { quality: 2 });
return {
title: songInformation.name,
stream: stream.stream,
duration: songInformation.durationInSec
}
}
module.exports.getStream = getStream;