From fa6c3f248747e2a969dc1129d17abbdedd14b452 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Tue, 25 Apr 2023 13:53:14 +0500 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D1=83=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D1=80=D0=B5=D0=B2=D1=88=D0=B5=D0=B9=20=D1=84=D1=83=D0=BD?= =?UTF-8?q?=D0=BA=D1=86=D0=B8=D0=B8=20=D0=B8=20=D0=BE=D1=88=D0=B8=D0=B1?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BD=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D0=B3=D0=BE=20=D0=BD=D0=B5=20=D1=83=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=20=D0=B2=20play?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/JaBa.js | 6 +++++- commands/Music/play.js | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/base/JaBa.js b/base/JaBa.js index 8bdac58c..43fe6228 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -34,7 +34,9 @@ class JaBa extends Client { this.databaseCache.usersReminds = new Collection(); this.databaseCache.mutedUsers = new Collection(); - this.player = Player.singleton(this); + this.player = Player.singleton(this, { + autoRegisterExtractor: false, + }); this.player.events.on("playerStart", async (queue, track) => { const m = await queue.metadata.channel.send({ content: this.translate("music/play:NOW_PLAYING", { songName: track.title }, queue.metadata.channel.guild.data.language) }); @@ -84,6 +86,8 @@ class JaBa extends Client { this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error"); }); + await this.player.extractors.loadDefault(); + const autoUpdateDocs = require("../helpers/autoUpdateDocs"); autoUpdateDocs.update(this); } diff --git a/commands/Music/play.js b/commands/Music/play.js index f51856f2..fe947921 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -82,8 +82,10 @@ class Play extends BaseCommand { * @returns */ async autocompleteRun(client, interaction) { - const query = interaction.options.getString("query"), - results = await client.player.search(query); + const query = interaction.options.getString("query"); + if (query.includes("http") || query === "") return; + + const results = await client.player.search(query); return interaction.respond( results.tracks.slice(0, 10).map(track => ({