mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 14:38:49 +00:00
feat: Change from yt-stream to @distube/ytdl-core for streaming audio
This commit is contained in:
1 parent
f6bf0e6e41
commit
fa15af5b14
4 files changed
+47
-10
No files matched your search
@@ -1,6 +1,5 @@
|
||||
const logger = require('../../services/logger');
|
||||
const { Player, onBeforeCreateStream } = require('discord-player');
|
||||
const { stream } = require('yt-stream');
|
||||
|
||||
exports.createPlayer = async (client) => {
|
||||
try {
|
||||
@@ -23,6 +22,7 @@ exports.createPlayer = async (client) => {
|
||||
// primarily to be able to use it in broadcastEval and other sharding methods
|
||||
global.player = player;
|
||||
|
||||
/* Seems to not be needed with @distube/ytdl-core, long duration videos work fine, keeping commented for now
|
||||
onBeforeCreateStream(async (track) => {
|
||||
if (track.source === 'youtube') {
|
||||
return (
|
||||
@@ -37,6 +37,7 @@ exports.createPlayer = async (client) => {
|
||||
|
||||
return null;
|
||||
});
|
||||
*/
|
||||
|
||||
await player.extractors.loadDefault();
|
||||
logger.trace(`[Shard ${client.shard.ids[0]}] discord-player loaded dependencies:\n${player.scanDeps()}`);
|
||||
|
||||
Reference in new issue
Block a user