Androz2091 / discord-music-bot

The perfect music bot for your Discord server! 🤘
238 stars 128 forks source link

Managed to fix that in a dirty-way. All you have to do is edit the `discord-player/dist/Structures/Queue.js` file with following changes: #53

Closed samusaran closed 2 years ago

samusaran commented 2 years ago

Managed to fix that in a dirty-way. All you have to do is edit the discord-player/dist/Structures/Queue.js file with following changes:

Lines: 36-37

const PlayerError_1 = require("./PlayerError");
+ const ytdl = require("ytdl-core");

Lines: 637-639

+if (["youtube"].includes(track.raw.source)) {
+    stream = ytdl(track.url, { filter: 'audioonly' }, { passes: 3 })
+} else if (["spotify"].includes(track.raw.source)) {
-if (["youtube", "spotify"].includes(track.raw.source)) {

Lines: 667-669

const resource = this.connection.createStream(stream, {
+  type: (track.raw.source === "youtube") ? voice_1.StreamType.WebmOpus : voice_1.StreamType.Raw,
-  type: voice_1.StreamType.Raw,
   data: track
});

Originally posted by @metonator in https://github.com/Androz2091/discord-music-bot/issues/24#issuecomment-922339568