Create Discord Music Bot

Can play and queue, can play music in multiple servers at once
This commit is contained in:
Myx
2023-06-21 04:24:58 +02:00
commit d9408907dd
13 changed files with 3177 additions and 0 deletions

View 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;