From 7c5655b0ef9c4a771d0041b4c61556bb204d8c31 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Thu, 4 Aug 2022 23:52:31 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TO REWRITE/Economy/importmee6.js | 29 +++++++++++++++++++++++++++++ base/JaBa.js | 8 +------- commands/Music/queue.js | 10 +++++++--- commands/Music/skip.js | 4 ++-- languages/ru-RU/music/queue.json | 2 +- 5 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 TO REWRITE/Economy/importmee6.js diff --git a/TO REWRITE/Economy/importmee6.js b/TO REWRITE/Economy/importmee6.js new file mode 100644 index 00000000..c76f0352 --- /dev/null +++ b/TO REWRITE/Economy/importmee6.js @@ -0,0 +1,29 @@ +const { getUserXp } = require("mee6-levels-api"); +const Command = require("../../base/Command"), + Discord = require("discord.js"); + +class ImportMee6 extends Command { + constructor(client) { + super(client, { + name: "money", + dirname: __dirname, + enabled: true, + guildOnly: true, + aliases: [], + memberPermissions: [], + botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], + nsfw: false, + ownerOnly: false, + cooldown: 1000 + }); + } + + async run(message, args, data) { + await getUserXp(message.guild.id, message.author.id).then(user => { + Levels.setLevel(message.author.id, message.guild.id, user.level); + message.lineReply(`Ваш уровень Mee6 синхронизирован! Новый уровень - ${user.level}`); + }); + } +}; + +module.exports = ImportMee6; \ No newline at end of file diff --git a/base/JaBa.js b/base/JaBa.js index 73527652..6e6c854a 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -51,7 +51,7 @@ class JaBa extends Client { this.discordTogether = new DiscordTogether(this); - playdl.getFreeClientID().then((clientID) => { + playdl.getFreeClientID().then(clientID => { playdl.setToken({ soundcloud: { client_id: clientID @@ -60,12 +60,6 @@ class JaBa extends Client { }); this.player = new Player(this); - // ytdlOptions: { - // filter: "audioonly", - // highWaterMark: 1 << 30, - // dlChunkSize: 0, - // liveBuffer: 4900 - // } this.player.use("jaba", extractor); this.player diff --git a/commands/Music/queue.js b/commands/Music/queue.js index 0151fb7b..64633e5a 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -35,7 +35,7 @@ class Queue extends BaseCommand { if (!queue) return interaction.error("music/play:NOT_PLAYING"); const currentTrack = queue.current; - const tracks = queue.tracks.slice(0, 10).map((track, i) => { + const tracks = queue.tracks.slice(0, 5).map((track, i) => { return `${i + 1}. [${track.title}](${track.url})\n> ${interaction.translate("music/queue:ADDED")} ${track.requestedBy}`; }); @@ -48,11 +48,15 @@ class Queue extends BaseCommand { .addFields( { name: interaction.translate("music/nowplaying:CURRENTLY_PLAYING"), - value: `[${currentTrack.title}](${currentTrack.url})\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}` + value: `[${currentTrack.title}](${currentTrack.url})\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}\n` + }, + { + name: interaction.translate("music/queue:QUEUE"), + value: tracks.join("\n") }, { name: "\u200b", - value: `${tracks.join("\n")}\n${interaction.translate("music/queue:MORE", { + value: `${interaction.translate("music/queue:MORE", { tracks: `${queue.tracks.length - tracks.length} ${client.getNoun(queue.tracks.length - tracks.length, interaction.translate("misc:NOUNS:TRACKS:1"), interaction.translate("misc:NOUNS:TRACKS:2"), interaction.translate("misc:NOUNS:TRACKS:5"))}` })}` } diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 1cb87255..6677a4f9 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -41,9 +41,9 @@ class Skip extends BaseCommand { .setAuthor({ name: interaction.translate("music/skip:SUCCESS") }) - .setThumbnail(queue.tracks[1].thumbnail) + .setThumbnail(queue.tracks[1].thumbnail || null) .setDescription(interaction.translate("music/play:NOW_PLAYING", { - songName: queue.tracks[1].name + songName: queue.tracks[1].title })) .setFooter({ text: client.config.embed.footer diff --git a/languages/ru-RU/music/queue.json b/languages/ru-RU/music/queue.json index b1d0b559..abff21a0 100644 --- a/languages/ru-RU/music/queue.json +++ b/languages/ru-RU/music/queue.json @@ -2,7 +2,7 @@ "DESCRIPTION": "Показать очередь на воспроизведение", "USAGE": "queue", "EXAMPLES": "queue", - "TITLE": "Очередь", + "QUEUE": "Очередь", "ADDED": "Добавил", "MORE": "и ещё {{tracks}}" } \ No newline at end of file