mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
фикс устаревшей функции и ошибки если ничего не указано в play
This commit is contained in:
parent
352bf476c5
commit
fa6c3f2487
2 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 => ({
|
||||
|
|
Loading…
Reference in a new issue