diff --git a/base/JaBa.js b/base/JaBa.js index 3730aa55..c7b17ab2 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -11,7 +11,7 @@ const BaseEvent = require("./BaseEvent.js"), path = require("path"), fs = require("fs").promises, mongoose = require("mongoose"), - extractor = require("../helpers/extractor"), + // extractor = require("../helpers/extractor"), playdl = require("play-dl"), moment = require("moment"); @@ -60,7 +60,7 @@ class JaBa extends Client { }); this.player = new Player(this); - this.player.use("jaba", extractor); + // this.player.use("jaba", extractor); this.player .on("trackStart", async (queue, track) => { diff --git a/commands/Music/play.js b/commands/Music/play.js index ae8497fb..8640b8e3 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -1,5 +1,6 @@ const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); -const BaseCommand = require("../../base/BaseCommand"); +const BaseCommand = require("../../base/BaseCommand"), + playdl = require("play-dl"); class Play extends BaseCommand { /** @@ -43,7 +44,7 @@ class Play extends BaseCommand { const searchResult = await client.player.search(query, { requestedBy: interaction.user, - searchEngine: "jaba" + // searchEngine: "jaba" }).catch(() => {}); if (!searchResult || !searchResult.tracks.length) return interaction.editReply({ content: interaction.translate("music/play:NO_RESULT", { @@ -59,7 +60,11 @@ class Play extends BaseCommand { leaveOnStop: true, bufferingTimeout: 1000, disableVolume: false, - spotifyBridge: false + spotifyBridge: false, + async onBeforeCreateStream(track, source) { + if (source === "youtube" || source === "soundcloud") + return (await playdl.stream(track.url, { discordPlayerCompatibility: true })).stream; + } }); searchResult.playlist ? queue.addTracks(searchResult.tracks) : queue.addTrack(searchResult.tracks[0]); diff --git a/package-lock.json b/package-lock.json index 8adfe6c9..960ce762 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "cron": "^1.7.2", "discord-api-types": "^0.37.0", "discord-giveaways": "^6.0.0", - "discord-player": "^5.3.0", + "discord-player": "^5.3.0-dev.3", "discord.js": "^14.1.2", "ejs": "^3.1.3", "express": "^4.17.1", @@ -1371,9 +1371,9 @@ } }, "node_modules/discord-player": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-5.3.0.tgz", - "integrity": "sha512-OskERYrsVqNvyq8tKkp3aV3NMY9dP5BhNeyn5NTTDohVd9eEE8P6rZGvxqORJl1OxXCTBLbiojNgLiFNsAIaow==", + "version": "5.3.0-dev.3", + "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-5.3.0-dev.3.tgz", + "integrity": "sha512-rrbEBS4mzCyIGk5S9E5O0XWnC4nub2cmBAFr9pZLH7RWBX4+z2nhAt5VwemgenmW/RJy1rseuZZ75WqJDnrHnw==", "dependencies": { "@discordjs/voice": "^0.11.0", "libsodium-wrappers": "^0.7.10", @@ -1381,7 +1381,7 @@ "spotify-url-info": "^3.1.2", "tiny-typed-emitter": "^2.1.0", "tslib": "^2.4.0", - "youtube-sr": "^4.3.0", + "youtube-sr": "^4.2.0", "ytdl-core": "^4.11.0" }, "funding": { @@ -5754,9 +5754,9 @@ } }, "discord-player": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-5.3.0.tgz", - "integrity": "sha512-OskERYrsVqNvyq8tKkp3aV3NMY9dP5BhNeyn5NTTDohVd9eEE8P6rZGvxqORJl1OxXCTBLbiojNgLiFNsAIaow==", + "version": "5.3.0-dev.3", + "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-5.3.0-dev.3.tgz", + "integrity": "sha512-rrbEBS4mzCyIGk5S9E5O0XWnC4nub2cmBAFr9pZLH7RWBX4+z2nhAt5VwemgenmW/RJy1rseuZZ75WqJDnrHnw==", "requires": { "@discordjs/voice": "^0.11.0", "libsodium-wrappers": "^0.7.10", @@ -5764,7 +5764,7 @@ "spotify-url-info": "^3.1.2", "tiny-typed-emitter": "^2.1.0", "tslib": "^2.4.0", - "youtube-sr": "^4.3.0", + "youtube-sr": "^4.2.0", "ytdl-core": "^4.11.0" } }, diff --git a/package.json b/package.json index 46304fad..a2d6eef5 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "cron": "^1.7.2", "discord-api-types": "^0.37.0", "discord-giveaways": "^6.0.0", - "discord-player": "^5.3.0", + "discord-player": "^5.3.0-dev.3", "discord.js": "^14.1.2", "ejs": "^3.1.3", "express": "^4.17.1",