Create Discord Music Bot
Can play and queue, can play music in multiple servers at once
This commit is contained in:
13
music_sources/soundcloud.js
Normal file
13
music_sources/soundcloud.js
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user