diff --git a/base/JaBa.js b/base/JaBa.js index a51ed6ca..76cdb0cc 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -1,5 +1,5 @@ const { Client, Collection, SlashCommandBuilder, ContextMenuCommandBuilder } = require("discord.js"), - { Player } = require("discord-player-play-dl"), + { Player } = require("discord-player"), { GiveawaysManager } = require("discord-giveaways"), { REST } = require("@discordjs/rest"), { Routes } = require("discord-api-types/v10"); @@ -43,7 +43,7 @@ class JaBa extends Client { this.databaseCache.usersReminds = new Collection(); this.databaseCache.mutedUsers = new Collection(); - this.player = new Player(this); + this.player = Player.singleton(this); playdl.getFreeClientID().then(id => playdl.setToken({ soundcloud: { @@ -51,7 +51,7 @@ class JaBa extends Client { }, })); - this.player.on("trackStart", async (queue, track) => { + 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) }); if (track.durationMS > 1) setTimeout(() => { @@ -60,16 +60,16 @@ class JaBa extends Client { else setTimeout(() => { if (m.deletable) m.delete(); - }, (10 * 60 * 1000)); // m * s * ms + }, (5 * 60 * 1000)); // m * s * ms }); - this.player.on("queueEnd", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.channel.guild.data.language))); - this.player.on("channelEmpty", queue => queue.metadata.channel.send(this.translate("music/play:STOP_EMPTY", null, queue.metadata.channel.guild.data.language))); - this.player.on("connectionError", (queue, e) => { - console.error(e); + this.player.events.on("emptyQueue", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.channel.guild.data.language))); + this.player.events.on("emptyChannel", queue => queue.metadata.channel.send(this.translate("music/play:STOP_EMPTY", null, queue.metadata.channel.guild.data.language))); + this.player.events.on("playerError", (queue, e) => { + console.log(e); queue.metadata.channel.send({ content: this.translate("music/play:ERR_OCCURRED", { error: e.message }, queue.metadata.channel.guild.data.language) }); }); - this.player.on("error", (queue, e) => { - console.error(e); + this.player.events.on("error", (queue, e) => { + console.log(e); queue.metadata.channel.send({ content: this.translate("music/play:ERR_OCCURRED", { error: e.message }, queue.metadata.channel.guild.data.language) }); }); diff --git a/commands/Music/back.js b/commands/Music/back.js index b2414936..a7c588f9 100644 --- a/commands/Music/back.js +++ b/commands/Music/back.js @@ -34,11 +34,11 @@ class Back extends BaseCommand { const voice = interaction.member.voice.channel; if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL", null, { ephemeral: true }); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { ephemeral: true }); - if (!queue.previousTracks[0]) return interaction.error("music/back:NO_PREV_SONG", null, { ephemeral: true }); + if (queue.history.isEmpty()) return interaction.error("music/back:NO_PREV_SONG", null, { ephemeral: true }); - queue.back(); + queue.history.back(); interaction.success("music/back:SUCCESS"); } } diff --git a/commands/Music/clips.js b/commands/Music/clips.js index 11f67000..9fa7ff88 100644 --- a/commands/Music/clips.js +++ b/commands/Music/clips.js @@ -1,5 +1,5 @@ -const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, EmbedBuilder, ButtonStyle } = require("discord.js"), - { joinVoiceChannel, createAudioResource, createAudioPlayer, getVoiceConnection, AudioPlayerStatus } = require("@discordjs/voice"); +const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"), + { QueryType } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"), fs = require("fs"); @@ -16,7 +16,8 @@ class Clips extends BaseCommand { .setDMPermission(false) .addStringOption(option => option.setName("query") .setDescription(client.translate("music/clips:QUERY")) - .setRequired(true)), + .setRequired(true) + .setAutocomplete(true)), aliases: [], dirname: __dirname, ownerOnly: false, @@ -36,195 +37,54 @@ class Clips extends BaseCommand { * @param {Object} data */ async execute(client, interaction) { - fs.readdir("./clips", async function (err, files) { - await interaction.deferReply(); + await interaction.deferReply(); - const query = interaction.options.getString("query"); + const query = interaction.options.getString("query"), + voice = interaction.member.voice.channel; + if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL", null, { edit: true }); - if (err) { - interaction.editReply({ - content: "```js\n" + err + "```", - }); - return console.log("Unable to read directory: " + err); - } + const perms = voice.permissionsFor(client.user); + if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.error("music/play:VOICE_CHANNEL_CONNECT", null, { edit: true }); - if (query === "list") { - const clips = files.map(file => file.substring(0, file.length - 4)); - let currentPage = 0; - const embeds = generateClipsEmbeds(interaction, clips); + client.player.play(interaction.member.voice.channel, query, { + nodeOptions: { + metadata: { + channel: interaction.channel, + client, + requestedBy: interaction.user, + }, + }, + searchEngine: QueryType.FILE, + selfDeaf: true, + leaveOnEnd: false, + leaveOnStop: true, + skipOnNoStream: true, + bufferingTimeout: 1000, + }); - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("clips_prev_page") - .setStyle(ButtonStyle.Primary) - .setEmoji("⬅️"), - new ButtonBuilder() - .setCustomId("clips_next_page") - .setStyle(ButtonStyle.Primary) - .setEmoji("➡️"), - new ButtonBuilder() - .setCustomId("clips_jump_page") - .setStyle(ButtonStyle.Secondary) - .setEmoji("↗️"), - new ButtonBuilder() - .setCustomId("clips_stop") - .setStyle(ButtonStyle.Danger) - .setEmoji("⏹️"), - ); - - await interaction.editReply({ - content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`, - embeds: [embeds[currentPage]], - components: [row], - }); - - const filter = i => i.user.id === interaction.user.id; - const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (20 * 1000) }); - - collector.on("collect", async i => { - if (i.isButton()) { - if (i.customId === "clips_prev_page") { - i.deferUpdate(); - - if (currentPage !== 0) { - --currentPage; - interaction.editReply({ - content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`, - embeds: [embeds[currentPage]], - components: [row], - }); - } - } else if (i.customId === "clips_next_page") { - i.deferUpdate(); - - if (currentPage < embeds.length - 1) { - currentPage++; - interaction.editReply({ - content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`, - embeds: [embeds[currentPage]], - components: [row], - }); - } - } else if (i.customId === "clips_jump_page") { - i.deferUpdate(); - - const msg = await interaction.followUp({ - content: interaction.translate("misc:JUMP_TO_PAGE", { - length: embeds.length, - }), - fetchReply: true, - }); - - const filter = res => { - return res.author.id === interaction.user.id && !isNaN(res.content); - }; - - interaction.channel.awaitMessages({ filter, max: 1, time: (10 * 1000) }).then(collected => { - if (embeds[collected.first().content - 1]) { - currentPage = collected.first().content - 1; - interaction.editReply({ - content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`, - embeds: [embeds[currentPage]], - components: [row], - }); - - if (collected.first().deletable) collected.first().delete(); - if (msg.deletable) msg.delete(); - } else { - if (collected.first().deletable) collected.first().delete(); - if (msg.deletable) msg.delete(); - return; - } - }); - } else if (i.customId === "clips_stop") { - i.deferUpdate(); - collector.stop(); - } - } - }); - - collector.on("end", () => { - row.components.forEach(component => { - component.setDisabled(true); - }); - - return interaction.editReply({ - components: [row], - }); - }); - } else { - const voice = interaction.member.voice.channel; - if (!voice) return interaction.editReply({ content: interaction.translate("music/play:NO_VOICE_CHANNEL") }); - - const queue = client.player.getQueue(interaction.guild.id); - if (queue) return interaction.editReply({ content: interaction.translate("music/clips:ACTIVE_QUEUE") }); - if (getVoiceConnection(interaction.guild.id)) return interaction.editReply({ content: interaction.translate("music/clips:ACTIVE_CLIP") }); - if (!fs.existsSync(`./clips/${query}.mp3`)) return interaction.editReply({ content: interaction.translate("music/clips:NO_CLIP", { file: query }) }); - - try { - const connection = joinVoiceChannel({ - channelId: voice.id, - guildId: interaction.guild.id, - adapterCreator: interaction.guild.voiceAdapterCreator, - }); - - const resource = createAudioResource(fs.createReadStream(`./clips/${query}.mp3`)); - const player = createAudioPlayer() - .on("error", err => { - connection.destroy(); - console.error(err.message); - }); - - player.play(resource); - connection.subscribe(player); - - player.on(AudioPlayerStatus.Idle, () => { - connection.destroy(); - }); - } catch (error) { - console.error(error); - } - - await interaction.editReply({ - content: interaction.translate("music/clips:PLAYING", { - clip: query, - }), - components: [], - }); - } + interaction.editReply({ + content: interaction.translate("music/play:ADDED_QUEUE", { + songName: query.substring(8, query.length - 4), + }), }); } -} -/** - * - * @param {import("discord.js").ChatInputCommandInteraction} interaction - * @param {Array} clips - * @returns - */ -function generateClipsEmbeds(interaction, clips) { - const embeds = []; - let k = 10; + /** + * + * @param {import("../../base/JaBa")} client + * @param {import("discord.js").AutocompleteInteraction} interaction + * @returns + */ + async autocompleteRun(client, interaction) { + const files = fs.readdirSync("./clips"); - for (let i = 0; i < clips.length; i += 10) { - const current = clips.slice(i, k); - k += 10; - - const page = current.join("\n"); - - const embed = new EmbedBuilder() - .setColor(interaction.client.config.embed.color) - .setFooter({ - text: interaction.client.config.embed.footer, - }) - .setTitle(interaction.translate("music/clips:CLIPS_LIST")) - .setDescription(page) - .setTimestamp(); - embeds.push(embed); + return interaction.respond( + files.slice(0, 10).map(file => ({ + name: file.substring(0, file.length - 4), + value: `./clips/${file}`, + }), + )); } - - return embeds; } module.exports = Clips; \ No newline at end of file diff --git a/commands/Music/loop.js b/commands/Music/loop.js index 9660881e..4a394c6e 100644 --- a/commands/Music/loop.js +++ b/commands/Music/loop.js @@ -1,5 +1,5 @@ const { SlashCommandBuilder } = require("discord.js"), - { QueueRepeatMode } = require("discord-player-play-dl"); + { QueueRepeatMode } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"); class Loop extends BaseCommand { @@ -44,7 +44,7 @@ class Loop extends BaseCommand { const voice = interaction.member.voice.channel; if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL", null, { edit: true }); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { edit: true }); const type = interaction.options.getString("option"), diff --git a/commands/Music/nowplaying.js b/commands/Music/nowplaying.js index 27ab4983..372ebc05 100644 --- a/commands/Music/nowplaying.js +++ b/commands/Music/nowplaying.js @@ -1,5 +1,5 @@ const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"), - { QueueRepeatMode } = require("discord-player-play-dl"); + { QueueRepeatMode } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"); class Nowplaying extends BaseCommand { @@ -34,10 +34,10 @@ class Nowplaying extends BaseCommand { async execute(client, interaction) { await interaction.deferReply(); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { edit: true }); - const progressBar = queue.createProgressBar(), - track = queue.current; + const progressBar = queue.node.createProgressBar(), + track = queue.currentTrack; const embed = new EmbedBuilder() .setAuthor({ @@ -58,7 +58,7 @@ class Nowplaying extends BaseCommand { { name: "\u200B", value: "\u200B", inline: true }, { name: interaction.translate("common:VIEWS"), - value: new Intl.NumberFormat(interaction.client.languages.find(language => language.name === interaction.guild.data.language).moment, { notation: "standard" }).format(track.views), + value: track.raw.live ? "" : new Intl.NumberFormat(interaction.client.languages.find(language => language.name === interaction.guild.data.language).moment, { notation: "standard" }).format(track.raw.views), inline: true, }, { diff --git a/commands/Music/play.js b/commands/Music/play.js index 86584046..b2ce898a 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField } = require("discord.js"); +const { SlashCommandBuilder, PermissionsBitField } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"); class Play extends BaseCommand { @@ -14,7 +14,8 @@ class Play extends BaseCommand { .setDMPermission(false) .addStringOption(option => option.setName("query") .setDescription(client.translate("music/play:QUERY")) - .setRequired(true)), + .setRequired(true) + .setAutocomplete(true)), aliases: [], dirname: __dirname, ownerOnly: false, @@ -43,195 +44,51 @@ class Play extends BaseCommand { const perms = voice.permissionsFor(client.user); if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.error("music/play:VOICE_CHANNEL_CONNECT", null, { edit: true }); - try { - // eslint-disable-next-line no-var - var searchResult = await client.player.search(query, { - requestedBy: interaction.user, - }); - - if (!searchResult.tracks[0] || !searchResult) - return interaction.error("music/play:NO_RESULT", { query, error: "Скорее всего видео заблокировано по региону" }, { edit: true }); - } catch (error) { - console.log(error); - return interaction.editReply({ - content: interaction.translate("music/play:NO_RESULT", { - query, - error, - }), - }); - } - - const queue = await client.player.getQueue(interaction.guildId) || client.player.createQueue(interaction.guild, { - metadata: { channel: interaction.channel }, - autoSelfDeaf: true, - leaveOnEnd: true, - leaveOnStop: true, - bufferingTimeout: 1000, + const searchResult = await client.player.search(query, { + requestedBy: interaction.user, }); - if (searchResult.searched) { - const row1 = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("1") - .setStyle(ButtonStyle.Secondary) - .setEmoji("1️⃣"), - new ButtonBuilder() - .setCustomId("2") - .setStyle(ButtonStyle.Secondary) - .setEmoji("2️⃣"), - new ButtonBuilder() - .setCustomId("3") - .setStyle(ButtonStyle.Secondary) - .setEmoji("3️⃣"), - new ButtonBuilder() - .setCustomId("4") - .setStyle(ButtonStyle.Secondary) - .setEmoji("4️⃣"), - new ButtonBuilder() - .setCustomId("5") - .setStyle(ButtonStyle.Secondary) - .setEmoji("5️⃣"), - ); - const row2 = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("6") - .setStyle(ButtonStyle.Secondary) - .setEmoji("6️⃣"), - new ButtonBuilder() - .setCustomId("7") - .setStyle(ButtonStyle.Secondary) - .setEmoji("7️⃣"), - new ButtonBuilder() - .setCustomId("8") - .setStyle(ButtonStyle.Secondary) - .setEmoji("8️⃣"), - new ButtonBuilder() - .setCustomId("9") - .setStyle(ButtonStyle.Secondary) - .setEmoji("9️⃣"), - new ButtonBuilder() - .setCustomId("10") - .setStyle(ButtonStyle.Secondary) - .setEmoji("🔟"), - ); - const row3 = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("search_cancel") - .setStyle(ButtonStyle.Secondary) - .setEmoji("❌"), - ); - const rows = [row1, row2, row3]; - - const embed = new EmbedBuilder() - .setTitle(interaction.translate("music/play:RESULTS_TITLE", { - query, - })) - .setColor(client.config.embed.color) - .setDescription(searchResult.tracks.map(track => { - let views; - if (track.raw.live) views = "🔴 LIVE"; - else views = new Intl.NumberFormat(interaction.client.languages.find(language => language.name === interaction.guild.data.language).moment, { - notation: "compact", compactDisplay: "short", - }).format(track.views); - - return `${searchResult.tracks.indexOf(track) + 1}. [${track.title}](${track.url})\n> ${interaction.translate("common:VIEWS")}: **${views}**\n`; - }).join("\n")) - .setTimestamp(); - - await interaction.editReply({ - embeds: [embed], - components: rows, - }); - - const filter = i => i.user.id === interaction.user.id; - const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (30 * 1000) }); - - collector.on("collect", async i => { - if (i.isButton()) { - if (i.customId >= 1 && i.customId <= 10) { - i.deferUpdate(); - - const selected = searchResult.tracks[i.customId - 1]; - queue.addTrack(selected); - - try { - if (!queue.connection) await queue.connect(interaction.member.voice.channel); - if (!queue.playing) await queue.play(); - - interaction.editReply({ - content: interaction.translate("music/play:ADDED_QUEUE", { - songName: selected.title, - }), - components: [], - embeds: [], - }); - - collector.stop(); - return; - } catch (error) { - client.player.deleteQueue(interaction.guildId); - console.log(error); - return interaction.editReply({ - content: interaction.translate("music/play:ERR_OCCURRED", { - error, - }), - }); - } - } else if (i.customId === "search_cancel") { - i.deferUpdate(); - - interaction.editReply({ - content: interaction.translate("misc:SELECT_CANCELED"), - embeds: [], - components: [], - }); - - collector.stop(); - return; - } - } - }); - - collector.on("end", async (_, reason) => { - if (reason === "idle") { - rows.forEach(row => { - row.components.forEach(component => { - component.setDisabled(true); - }); - }); - - return interaction.editReply({ - components: rows, - }); - } - }); - - return; - } - - searchResult.playlist ? queue.addTracks(searchResult.tracks) : queue.addTrack(searchResult.tracks[0]); - - try { - if (!queue.connection) await queue.connect(interaction.member.voice.channel); - if (!queue.playing) await queue.play(); - - interaction.editReply({ - content: interaction.translate("music/play:ADDED_QUEUE", { - songName: searchResult.playlist ? searchResult.playlist.title : searchResult.tracks[0].title, - }), - }); - } catch (error) { - client.player.deleteQueue(interaction.guildId); - console.log(error); - return interaction.editReply({ - content: interaction.translate("music/play:ERR_OCCURRED", { - error, - }), + if (!searchResult.hasTracks()) return interaction.error("music/play:NO_RESULT", { query }, { edit: true }); + else { + client.player.play(interaction.member.voice.channel, searchResult, { + nodeOptions: { + metadata: { + channel: interaction.channel, + client, + requestedBy: interaction.user, + }, + }, + selfDeaf: true, + leaveOnEnd: false, + leaveOnStop: true, + skipOnNoStream: true, + bufferingTimeout: 1000, }); } + + interaction.editReply({ + content: interaction.translate("music/play:ADDED_QUEUE", { + songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title, + }), + }); + } + + /** + * + * @param {import("../../base/JaBa")} client + * @param {import("discord.js").AutocompleteInteraction} interaction + * @returns + */ + async autocompleteRun(client, interaction) { + const query = interaction.options.getString("query", true), + results = await client.player.search(query); + + return interaction.respond( + results.tracks.slice(0, 10).map(track => ({ + name: `${track.author} - ${track.title}`.slice(0, 90) + "...", + value: track.url, + }), + )); } } diff --git a/commands/Music/queue.js b/commands/Music/queue.js index 69c7f264..99612370 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -1,5 +1,5 @@ const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js"), - { QueueRepeatMode } = require("discord-player-play-dl"); + { QueueRepeatMode } = require("discord-player"); const BaseCommand = require("../../base/BaseCommand"); class Queue extends BaseCommand { @@ -32,7 +32,7 @@ class Queue extends BaseCommand { * @param {Object} data */ async execute(client, interaction) { - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING"); let currentPage = 0; @@ -151,15 +151,15 @@ class Queue extends BaseCommand { /** * * @param {import("discord.js").ChatInputCommandInteraction} interaction - * @param {import("discord-player-play-dl").Queue} queue + * @param {import("discord-player").GuildQueue} queue * @returns */ function generateQueueEmbeds(interaction, queue) { const embeds = []; - const currentTrack = queue.current; + const currentTrack = queue.currentTrack; let k = 10; - if (!queue.tracks.length) { + if (!queue.tracks.size) { const embed = new EmbedBuilder() .setTitle(interaction.translate("music/nowplaying:CURRENTLY_PLAYING")) .setThumbnail(currentTrack.thumbnail) @@ -175,8 +175,8 @@ function generateQueueEmbeds(interaction, queue) { return embeds; } - for (let i = 0; i < queue.tracks.length; i += 10) { - const current = queue.tracks.slice(i, k); + for (let i = 0; i < queue.getSize(); i += 10) { + const current = queue.tracks.toArray().slice(i, k); let j = i; k += 10; @@ -190,7 +190,7 @@ function generateQueueEmbeds(interaction, queue) { queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") : queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") : queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED") - }\`\n${interaction.translate("music/queue:DURATION")}: \`${interaction.client.convertTime(Date.now() + queue.totalTime, false, true, interaction.guild.data.language)}\`\n[${currentTrack.title}](${currentTrack.url})\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}\n\n**${interaction.translate("music/queue:NEXT")}**\n${info}`) + }\`\n${interaction.translate("music/queue:DURATION")}: \`${interaction.client.convertTime(Date.now() + queue.node.streamTime, false, true, interaction.guild.data.language)}\`\n[${currentTrack.title}](${currentTrack.url})\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}\n\n**${interaction.translate("music/queue:NEXT")}**\n${info}`) .setTimestamp(); embeds.push(embed); } diff --git a/commands/Music/seek.js b/commands/Music/seek.js index f7c2db66..2b3dbf38 100644 --- a/commands/Music/seek.js +++ b/commands/Music/seek.js @@ -37,10 +37,10 @@ class Seek extends BaseCommand { voice = interaction.member.voice.channel; if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL"); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING"); - queue.seek(time * 1000); + queue.node.seek(time * 1000); interaction.success("music/seek:SUCCESS", { time: `**${time}** ${client.getNoun(time, interaction.translate("misc:NOUNS:SECONDS:1"), interaction.translate("misc:NOUNS:SECONDS:2"), interaction.translate("misc:NOUNS:SECONDS:5"))}`, }); diff --git a/commands/Music/shuffle.js b/commands/Music/shuffle.js index a74c6348..c41ed5a9 100644 --- a/commands/Music/shuffle.js +++ b/commands/Music/shuffle.js @@ -34,10 +34,10 @@ class Shuffle extends BaseCommand { const voice = interaction.member.voice.channel; if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL", null, { ephemeral: true }); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { ephemeral: true }); - queue.shuffle(); + queue.tracks.shuffle(); interaction.success("music/shuffle:SUCCESS"); } } diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 06e32650..f1b68cf8 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -34,10 +34,10 @@ class Skip extends BaseCommand { const voice = interaction.member.voice.channel; if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL"); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING"); - queue.skip(); + queue.node.skip(); interaction.success("music/skip:SUCCESS"); } } diff --git a/commands/Music/skipto.js b/commands/Music/skipto.js index ceb4e5cc..d0f4c6c2 100644 --- a/commands/Music/skipto.js +++ b/commands/Music/skipto.js @@ -37,14 +37,14 @@ class Skipto extends BaseCommand { const voice = interaction.member.voice.channel; if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL"); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING"); const position = interaction.options.getInteger("position"); if (position <= 0) return interaction.error("music/skipto:NO_PREV_SONG"); - if (queue.tracks[position - 1]) { - queue.skipTo(queue.tracks[position - 1]); + if (queue.tracks.at(position - 1)) { + queue.node.skipTo(queue.tracks.at(position - 1)); interaction.success("music/skipto:SUCCESS", { position: position, diff --git a/commands/Music/stop.js b/commands/Music/stop.js index 5cb77015..dfc7b797 100644 --- a/commands/Music/stop.js +++ b/commands/Music/stop.js @@ -34,10 +34,10 @@ class Stop extends BaseCommand { const voice = interaction.member.voice.channel; if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL"); - const queue = client.player.getQueue(interaction.guildId); + const queue = client.player.nodes.get(interaction.guildId); if (!queue) return interaction.error("music/play:NOT_PLAYING"); - queue.destroy(); + queue.delete(); interaction.success("music/stop:SUCCESS"); } } diff --git a/dashboard/public/docs/updates.md b/dashboard/public/docs/updates.md index 508f8d57..844539f5 100644 --- a/dashboard/public/docs/updates.md +++ b/dashboard/public/docs/updates.md @@ -1,3 +1,21 @@ +### JaBa v4.2.0 +Я решил отказаться от своего модуля музыки в пользу основного, т.к. он был переписан авторами и теперь работает намного лучше. + +Есть идея добавить запись голосовых, нужно или нет? пишите мне куда-нибудь, пожалуйста :crying_cat:\ +Бот будет **предупреждать** о том что голосовой будет **записан** в файл и выслан вам, после этого **удалён**.\ +Я не буду хранить ваши голосовые, у меня места не хватит на хостинге =) + +* Изменения + * Теперь в *play* и *clips* выполняется автозаполнение по написанному вами тексту - намного удобнее чем ждать сообщения от бота и выбирать из огромного столба. + * *seek* теперь работает нормально. + * Переписана команда *clips*. + +* Исправление + * Старые баги. + +* Добавлено + * Новые баги. + ### JaBa v4.1.20 * Добавлено * Команда *boosters* - Список бустеров с сортировкой по дате буста. diff --git a/events/CommandHandler.js b/events/CommandHandler.js index 98132f6a..38214107 100644 --- a/events/CommandHandler.js +++ b/events/CommandHandler.js @@ -15,8 +15,6 @@ class CommandHandler extends BaseEvent { * @param {import("discord.js").Interaction} interaction */ async execute(client, interaction) { - if (interaction.type !== InteractionType.ApplicationCommand && !interaction.isCommand()) return; - const command = client.commands.get(interaction.commandName); const data = []; @@ -25,9 +23,6 @@ class CommandHandler extends BaseEvent { }); data.userData = userData; - if (command.guildOnly && !interaction.inGuild()) return interaction.replyT("misc:GUILD_ONLY", { ephemeral: true }); - if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.replyT("misc:OWNER_ONLY", { ephemeral: true }); - if (interaction.inGuild()) { const guildData = await client.findOrCreateGuild({ id: interaction.guildId, @@ -41,6 +36,14 @@ class CommandHandler extends BaseEvent { data.memberData = memberData; } + if (interaction.isAutocomplete()) { + return await command.autocompleteRun(client, interaction); + } + if (interaction.type !== InteractionType.ApplicationCommand && !interaction.isCommand()) return; + + if (command.guildOnly && !interaction.inGuild()) return interaction.replyT("misc:GUILD_ONLY", { ephemeral: true }); + if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.replyT("misc:OWNER_ONLY", { ephemeral: true }); + if (!userData.achievements.firstCommand.achieved) { userData.achievements.firstCommand.progress.now = 1; userData.achievements.firstCommand.achieved = true; diff --git a/languages/ru-RU/music/play.json b/languages/ru-RU/music/play.json index ceb19eed..5ab42846 100644 --- a/languages/ru-RU/music/play.json +++ b/languages/ru-RU/music/play.json @@ -6,7 +6,7 @@ "NO_VOICE_CHANNEL": "Вы должны находиться в голосовом канале!", "VOICE_CHANNEL_CONNECT": "Я не могу присоедениться к вашему голосовому каналу!", "RESULTS_TITLE": "Результаты поиска по \"{{query}}\"", - "NO_RESULT": "Произошла ошибка при поиске `{{query}}`!\n```{{error}}```", + "NO_RESULT": "По запросу `{{query}}` ничего не найдено", "NOW_PLAYING": "Сейчас играет **{{songName}}**", "NOT_PLAYING": "На сервере сейчас ничего не воспроизводится", "QUEUE_ENDED": "Очередь окончена", diff --git a/languages/ru-RU/music/queue.json b/languages/ru-RU/music/queue.json index 330aba0d..9712b9ef 100644 --- a/languages/ru-RU/music/queue.json +++ b/languages/ru-RU/music/queue.json @@ -4,7 +4,7 @@ "EXAMPLES": "queue", "QUEUE": "Очередь", "NO_QUEUE": "Пусто", - "DURATION": "Длительность очереди", + "DURATION": "Играю уже", "ADDED": "Добавил", "NEXT_PAGE": "След. страница", "PREV_PAGE": "Пред. страница", diff --git a/languages/uk-UA/music/play.json b/languages/uk-UA/music/play.json index e7461c1f..331d5e36 100644 --- a/languages/uk-UA/music/play.json +++ b/languages/uk-UA/music/play.json @@ -6,7 +6,7 @@ "NO_VOICE_CHANNEL": "Ви повинні знаходитися в голосовому каналі!", "VOICE_CHANNEL_CONNECT": "Я не можу приєднатися до вашого голосового каналу!", "RESULTS_TITLE": "Результати пошуку за \"{{query}}\"", - "NO_RESULT": "Відбулася помилка при пошуку `{{query}}`!\n``{{error}}```", + "NO_RESULT": "За запитом `{{query}}` нічого не знайдено", "NOW_PLAYING": "Зараз грає **{{songName}}**", "NOT_PLAYING": "На сервері зараз нічого не відтворюється", "QUEUE_ENDED": "Черга закінчена", diff --git a/languages/uk-UA/music/queue.json b/languages/uk-UA/music/queue.json index ecb01656..4392c114 100644 --- a/languages/uk-UA/music/queue.json +++ b/languages/uk-UA/music/queue.json @@ -4,7 +4,7 @@ "EXAMPLES": "queue", "QUEUE": "Черга", "NO_QUEUE": "Пусто", - "DURATION": "Тривалість черги", + "DURATION": "Граю вже", "ADDED": "Додав", "NEXT_PAGE": "Наступна сторінка", "PREV_PAGE": "Попередня сторінка", diff --git a/package-lock.json b/package-lock.json index bae4074e..c38ead4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "jaba", - "version": "4.1.20", + "version": "4.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "jaba", - "version": "4.1.20", + "version": "4.2.0", "license": "ISC", "dependencies": { - "@discord-player/extractor": "^4.0.0", + "@discord-player/extractor": "^4.1.2", "@discordjs/opus": "^0.9.0", "@discordjs/rest": "^1.6.0", "@discordjs/voice": "^0.15.0", @@ -20,7 +20,7 @@ "cron": "^2.1.0", "discord-api-types": "^0.37.36", "discord-giveaways": "^6.0.1", - "discord-player-play-dl": "^5.3.14", + "discord-player": "^6.1.1", "discord.js": "^14.8.0", "ejs": "^3.1.3", "express": "^4.17.1", @@ -32,7 +32,8 @@ "md5": "^2.2.1", "moment": "^2.26.0", "mongoose": "^5.13.15", - "ms": "^2.1.3" + "ms": "^2.1.3", + "play-dl": "^1.9.6" }, "devDependencies": { "eslint": "^8.23.0" @@ -50,19 +51,17 @@ } }, "node_modules/@discord-player/equalizer": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@discord-player/equalizer/-/equalizer-0.1.4.tgz", - "integrity": "sha512-y87Mwj+38v8sRGfC/jSRykiQhpMV7yUI8Rq+xvczG6u/wBX1bkY53H5RjUZx4of2MLMNnMd9CF+z65E56Ps8DA==", - "peer": true + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discord-player/equalizer/-/equalizer-0.2.1.tgz", + "integrity": "sha512-PPjX8TBwzM85YKEdpYYL8aGbdSLIk9RK1h/uU5jeyiF6Uu5CiLH/XctDfcGW8cSgoaU4J0R6a8svCs9yhzHXSw==" }, "node_modules/@discord-player/extractor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@discord-player/extractor/-/extractor-4.0.0.tgz", - "integrity": "sha512-j5Q71j0DHKCgIirRaN8+Vmhlo4+Gb2+Zf18K7oA8nN03oJiUzepw/2f3RIcCf9QbuoD1xUUHlWqqzMBDn1aq1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@discord-player/extractor/-/extractor-4.1.2.tgz", + "integrity": "sha512-sG0KG3tC9/t2hnzXP7amaURbZ+7KfIXma+sH2UyAJKqX3LgYnFvUxm1deL29lPrqf8wjR9XEEOt5TOxpsyP74Q==", "dependencies": { "file-type": "^16.5.4", "genius-lyrics": "^4.4.2", - "node-fetch": "cjs", "node-html-parser": "^6.1.4", "reverbnation-scraper": "^2.0.0", "soundcloud-scraper": "^5.0.3", @@ -70,7 +69,6 @@ "youtube-sr": "^4.3.4" }, "peerDependencies": { - "discord-player": "*", "play-dl": "1.x", "ytdl-core": "4.x" } @@ -135,6 +133,14 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/@discord-player/utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discord-player/utils/-/utils-0.2.1.tgz", + "integrity": "sha512-yPxfdO2N3i2YEEiwlLDNyuBEdnhV1mZaC7im2BI4FKn3ak1UAtVcbKeJhdd/va0A170+PZs3zUKVGldY0z/+ng==", + "dependencies": { + "@discordjs/collection": "^1.1.0" + } + }, "node_modules/@discordjs/builders": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.5.0.tgz", @@ -1474,82 +1480,24 @@ } }, "node_modules/discord-player": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-5.4.0.tgz", - "integrity": "sha512-Hrab+4aNCZCGJwsGkiQx+nfvJNqMEr9T+vEAzTOybWJ83InJOxUK7t6muVqHlkonmXBM/nVOczWs2qacDlRH6g==", - "peer": true, + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-6.1.1.tgz", + "integrity": "sha512-gIN0V+IBT1xcLmzFqfbq9pM8B7crZvbfTwdey1R99P3DdAfaRbg+F1hw9l5ftK2X492O3uAjev+ZBh1CcFU3pQ==", "dependencies": { - "@discord-player/equalizer": "^0.1.2", - "@discordjs/voice": "^0.11.0", - "libsodium-wrappers": "^0.7.10", - "tiny-typed-emitter": "^2.1.0", - "tslib": "^2.4.0" + "@discord-player/equalizer": "*", + "@discord-player/utils": "*", + "@discordjs/voice": "latest", + "libsodium-wrappers": "^0.7.10" }, "funding": { "url": "https://github.com/Androz2091/discord-player?sponsor=1" }, "peerDependencies": { - "soundcloud-scraper": "5.x", - "spotify-url-info": "3.x", - "youtube-sr": "4.x", - "ytdl-core": "4.x" + "@discord-player/extractor": "*", + "discord.js": "14.x", + "youtube-sr": "4.x" } }, - "node_modules/discord-player-play-dl": { - "version": "5.3.14", - "resolved": "https://registry.npmjs.org/discord-player-play-dl/-/discord-player-play-dl-5.3.14.tgz", - "integrity": "sha512-kN0tOno4iI2GD7zZB4Ro/QpUp4+lclecl71TCw7BZGR0t/0yIezY3ix0QNq+XjCOFrBl0XlU3poJWe2lRRsmMw==", - "dependencies": { - "@discordjs/voice": "^0.11.0", - "libsodium-wrappers": "^0.7.10", - "play-dl": "^1.9.6", - "spotify-url-info": "^3.1.2", - "tiny-typed-emitter": "^2.1.0", - "tslib": "^2.4.0" - } - }, - "node_modules/discord-player-play-dl/node_modules/@discordjs/voice": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.11.0.tgz", - "integrity": "sha512-6+9cj1dxzBJm7WJ9qyG2XZZQ8rcLl6x2caW0C0OxuTtMLAaEDntpb6lqMTFiBg/rDc4Rd59g1w0gJmib33CuHw==", - "dependencies": { - "@types/ws": "^8.5.3", - "discord-api-types": "^0.36.2", - "prism-media": "^1.3.4", - "tslib": "^2.4.0", - "ws": "^8.8.1" - }, - "engines": { - "node": ">=16.9.0" - } - }, - "node_modules/discord-player-play-dl/node_modules/discord-api-types": { - "version": "0.36.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", - "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" - }, - "node_modules/discord-player/node_modules/@discordjs/voice": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.11.0.tgz", - "integrity": "sha512-6+9cj1dxzBJm7WJ9qyG2XZZQ8rcLl6x2caW0C0OxuTtMLAaEDntpb6lqMTFiBg/rDc4Rd59g1w0gJmib33CuHw==", - "peer": true, - "dependencies": { - "@types/ws": "^8.5.3", - "discord-api-types": "^0.36.2", - "prism-media": "^1.3.4", - "tslib": "^2.4.0", - "ws": "^8.8.1" - }, - "engines": { - "node": ">=16.9.0" - } - }, - "node_modules/discord-player/node_modules/discord-api-types": { - "version": "0.36.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", - "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==", - "peer": true - }, "node_modules/discord.js": { "version": "14.8.0", "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.8.0.tgz", @@ -2766,16 +2714,16 @@ } }, "node_modules/libsodium": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", - "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.11.tgz", + "integrity": "sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A==" }, "node_modules/libsodium-wrappers": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", - "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.11.tgz", + "integrity": "sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q==", "dependencies": { - "libsodium": "^0.7.0" + "libsodium": "^0.7.11" } }, "node_modules/locate-path": { @@ -4283,11 +4231,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/tiny-typed-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", - "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -4560,19 +4503,17 @@ } }, "@discord-player/equalizer": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@discord-player/equalizer/-/equalizer-0.1.4.tgz", - "integrity": "sha512-y87Mwj+38v8sRGfC/jSRykiQhpMV7yUI8Rq+xvczG6u/wBX1bkY53H5RjUZx4of2MLMNnMd9CF+z65E56Ps8DA==", - "peer": true + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discord-player/equalizer/-/equalizer-0.2.1.tgz", + "integrity": "sha512-PPjX8TBwzM85YKEdpYYL8aGbdSLIk9RK1h/uU5jeyiF6Uu5CiLH/XctDfcGW8cSgoaU4J0R6a8svCs9yhzHXSw==" }, "@discord-player/extractor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@discord-player/extractor/-/extractor-4.0.0.tgz", - "integrity": "sha512-j5Q71j0DHKCgIirRaN8+Vmhlo4+Gb2+Zf18K7oA8nN03oJiUzepw/2f3RIcCf9QbuoD1xUUHlWqqzMBDn1aq1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@discord-player/extractor/-/extractor-4.1.2.tgz", + "integrity": "sha512-sG0KG3tC9/t2hnzXP7amaURbZ+7KfIXma+sH2UyAJKqX3LgYnFvUxm1deL29lPrqf8wjR9XEEOt5TOxpsyP74Q==", "requires": { "file-type": "^16.5.4", "genius-lyrics": "^4.4.2", - "node-fetch": "cjs", "node-html-parser": "^6.1.4", "reverbnation-scraper": "^2.0.0", "soundcloud-scraper": "^5.0.3", @@ -4615,6 +4556,14 @@ } } }, + "@discord-player/utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discord-player/utils/-/utils-0.2.1.tgz", + "integrity": "sha512-yPxfdO2N3i2YEEiwlLDNyuBEdnhV1mZaC7im2BI4FKn3ak1UAtVcbKeJhdd/va0A170+PZs3zUKVGldY0z/+ng==", + "requires": { + "@discordjs/collection": "^1.1.0" + } + }, "@discordjs/builders": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.5.0.tgz", @@ -5587,69 +5536,14 @@ } }, "discord-player": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-5.4.0.tgz", - "integrity": "sha512-Hrab+4aNCZCGJwsGkiQx+nfvJNqMEr9T+vEAzTOybWJ83InJOxUK7t6muVqHlkonmXBM/nVOczWs2qacDlRH6g==", - "peer": true, + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/discord-player/-/discord-player-6.1.1.tgz", + "integrity": "sha512-gIN0V+IBT1xcLmzFqfbq9pM8B7crZvbfTwdey1R99P3DdAfaRbg+F1hw9l5ftK2X492O3uAjev+ZBh1CcFU3pQ==", "requires": { - "@discord-player/equalizer": "^0.1.2", - "@discordjs/voice": "^0.11.0", - "libsodium-wrappers": "^0.7.10", - "tiny-typed-emitter": "^2.1.0", - "tslib": "^2.4.0" - }, - "dependencies": { - "@discordjs/voice": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.11.0.tgz", - "integrity": "sha512-6+9cj1dxzBJm7WJ9qyG2XZZQ8rcLl6x2caW0C0OxuTtMLAaEDntpb6lqMTFiBg/rDc4Rd59g1w0gJmib33CuHw==", - "peer": true, - "requires": { - "@types/ws": "^8.5.3", - "discord-api-types": "^0.36.2", - "prism-media": "^1.3.4", - "tslib": "^2.4.0", - "ws": "^8.8.1" - } - }, - "discord-api-types": { - "version": "0.36.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", - "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==", - "peer": true - } - } - }, - "discord-player-play-dl": { - "version": "5.3.14", - "resolved": "https://registry.npmjs.org/discord-player-play-dl/-/discord-player-play-dl-5.3.14.tgz", - "integrity": "sha512-kN0tOno4iI2GD7zZB4Ro/QpUp4+lclecl71TCw7BZGR0t/0yIezY3ix0QNq+XjCOFrBl0XlU3poJWe2lRRsmMw==", - "requires": { - "@discordjs/voice": "^0.11.0", - "libsodium-wrappers": "^0.7.10", - "play-dl": "^1.9.6", - "spotify-url-info": "^3.1.2", - "tiny-typed-emitter": "^2.1.0", - "tslib": "^2.4.0" - }, - "dependencies": { - "@discordjs/voice": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.11.0.tgz", - "integrity": "sha512-6+9cj1dxzBJm7WJ9qyG2XZZQ8rcLl6x2caW0C0OxuTtMLAaEDntpb6lqMTFiBg/rDc4Rd59g1w0gJmib33CuHw==", - "requires": { - "@types/ws": "^8.5.3", - "discord-api-types": "^0.36.2", - "prism-media": "^1.3.4", - "tslib": "^2.4.0", - "ws": "^8.8.1" - } - }, - "discord-api-types": { - "version": "0.36.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", - "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" - } + "@discord-player/equalizer": "*", + "@discord-player/utils": "*", + "@discordjs/voice": "latest", + "libsodium-wrappers": "^0.7.10" } }, "discord.js": { @@ -6582,16 +6476,16 @@ } }, "libsodium": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", - "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.11.tgz", + "integrity": "sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A==" }, "libsodium-wrappers": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", - "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.11.tgz", + "integrity": "sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q==", "requires": { - "libsodium": "^0.7.0" + "libsodium": "^0.7.11" } }, "locate-path": { @@ -7675,11 +7569,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "tiny-typed-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", - "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==" - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/package.json b/package.json index d6cfa854..3184ad21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jaba", - "version": "4.1.20", + "version": "4.2.0", "description": "My Discord Bot", "main": "index.js", "private": true, @@ -12,7 +12,7 @@ "author": "Jonny_Bro#4226", "license": "ISC", "dependencies": { - "@discord-player/extractor": "^4.0.0", + "@discord-player/extractor": "^4.1.2", "@discordjs/opus": "^0.9.0", "@discordjs/rest": "^1.6.0", "@discordjs/voice": "^0.15.0", @@ -23,7 +23,7 @@ "cron": "^2.1.0", "discord-api-types": "^0.37.36", "discord-giveaways": "^6.0.1", - "discord-player-play-dl": "^5.3.14", + "discord-player": "^6.1.1", "discord.js": "^14.8.0", "ejs": "^3.1.3", "express": "^4.17.1", @@ -35,7 +35,8 @@ "md5": "^2.2.1", "moment": "^2.26.0", "mongoose": "^5.13.15", - "ms": "^2.1.3" + "ms": "^2.1.3", + "play-dl": "^1.9.6" }, "devDependencies": { "eslint": "^8.23.0"