From 34193eea4476b5b41cd1cbccc717ac8dec1fe90d Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Mon, 1 Aug 2022 20:06:09 +0500 Subject: [PATCH] =?UTF-8?q?help=20:poggersfish:=20=D0=9C=D0=B5=D0=BB=D0=BA?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TO REWRITE/General/help.js | 139 --------------------- TO REWRITE/Moderation/announcement.js | 2 +- TO REWRITE/Moderation/poll.js | 2 +- base/JaBa.js | 33 +++-- commands/Fun/8ball.js | 2 +- commands/Fun/lmgtfy.js | 2 +- commands/Fun/lovecalc.js | 2 +- commands/Fun/memes.js | 4 +- commands/General/activity.js | 7 +- commands/General/help.js | 166 ++++++++++++++++++++++++++ commands/General/ping.js | 2 +- commands/Moderation/warn.js | 10 +- commands/NSFW/nsfw.js | 4 +- commands/Owner/debug.js | 2 +- commands/Owner/eval.js | 2 +- commands/Owner/reload.js | 4 +- commands/Owner/say.js | 2 +- commands/Owner/servers.js | 4 +- dashboard/utils.js | 1 - helpers/autoUpdateDocs.js | 4 +- languages/ru-RU/general/help.json | 5 +- languages/ru-RU/misc.json | 43 +++++++ languages/ru-RU/moderation/warn.json | 4 +- languages/ru-RU/moderation/warns.json | 4 +- languages/ru-RU/owner/reload.json | 1 - languages/uk-UA/misc.json | 45 +++++++ package.json | 1 + 27 files changed, 304 insertions(+), 193 deletions(-) delete mode 100644 TO REWRITE/General/help.js create mode 100644 commands/General/help.js diff --git a/TO REWRITE/General/help.js b/TO REWRITE/General/help.js deleted file mode 100644 index aae84a44..00000000 --- a/TO REWRITE/General/help.js +++ /dev/null @@ -1,139 +0,0 @@ -const Command = require("../../base/Command"), - { PermissionsBitField, EmbedBuilder } = require("discord.js"); - -class Help extends Command { - constructor(client) { - super(client, { - name: "help", - dirname: __dirname, - enabled: true, - guildOnly: false, - aliases: ["h", "commands"], - memberPermissions: [], - botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], - nsfw: false, - ownerOnly: false, - cooldown: 1000 - }); - } - - async run(message, args, data) { - if (args[0]) { - const isCustom = (message.guild && data.guild.customCommands ? data.guild.customCommands.find((c) => c.name === args[0]) : false); - - const cmd = this.client.commands.get(args[0]) || this.client.commands.get(this.client.aliases.get(args[0])); - if (!cmd && isCustom) { - return message.error("general/help:CUSTOM", { - cmd: args[0] - }); - } else if (!cmd) { - return message.error("general/help:NOT_FOUND", { - search: args[0] - }); - } - - const description = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:DESCRIPTION`); - const usage = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`, { - prefix: message.guild ? data.guild.prefix : "" - }); - const examples = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:EXAMPLES`, { - prefix: message.guild ? data.guild.prefix : "" - }); - - const groupEmbed = new EmbedBuilder() - .setAuthor({ - name: message.translate("general/help:CMD_TITLE", { - cmd: cmd.help.name - }) - }) - .addFields([ - { - name: message.translate("general/help:FIELD_DESCRIPTION"), - value: description - }, - { - name: message.translate("general/help:FIELD_USAGE"), - value: usage - }, - { - name: message.translate("general/help:FIELD_EXAMPLES"), - value: examples - }, - { - name: message.translate("general/help:FIELD_ALIASES"), - value: cmd.help.aliases.length > 0 ? cmd.help.aliases.map(a => "`" + a + "`").join("\n") : message.translate("general/help:NO_ALIAS") - }, - { - name: message.translate("general/help:FIELD_PERMISSIONS"), - value: cmd.conf.memberPermissions.length > 0 ? cmd.conf.memberPermissions.map((p) => `\`${p}\``).join("\n") : message.translate("general/help:NO_REQUIRED_PERMISSION") - } - ]) - .setColor(data.config.embed.color) - .setFooter({ - text: data.config.embed.footer - }); - - return message.reply({ - embeds: [groupEmbed] - }); - } - - const categories = []; - const commands = this.client.commands; - - commands.forEach((command) => { - if (!categories.includes(command.help.category)) { - if (command.help.category === "Owner" && message.author.id !== data.config.owner.id) return; - categories.push(command.help.category); - } - }); - - const emojis = this.client.customEmojis; - - const embed = new EmbedBuilder() - .setDescription(message.translate("general/help:INFO", { - prefix: message.guild ? data.guild.prefix : "" - })) - .setColor(data.config.embed.color) - .setFooter({ - text: data.config.embed.footer - }); - categories.sort().forEach((cat) => { - const tCommands = commands.filter((cmd) => cmd.help.category === cat); - embed.addFields([ - { - name: `${emojis.categories[cat.toLowerCase()]} ${cat} - (${tCommands.size})`, - value: `${tCommands.map((cmd) => `\`${cmd.help.name}\``).join(", ")}` - } - ]); - }); - - embed.addFields([ - { - name: "\u200B", - value: message.translate("misc:STATS_FOOTER", { - dashboardLink: this.client.config.dashboard.baseURL, - docsLink: `${this.client.config.dashboard.baseURL}/docs/`, - inviteLink: this.client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [ PermissionsBitField.Flags.Administrator] }), - donateLink: "https://qiwi.com/n/JONNYBRO/", - owner: data.config.owner.id - }) - } - ]); - embed.setAuthor({ - name: message.translate("general/help:TITLE", { - name: this.client.user.username - }), - iconURL: this.client.user.displayAvatarURL({ - size: 512, - format: "png" - }) - }); - - return message.reply({ - embeds: [embed] - }); - } -} - -module.exports = Help; \ No newline at end of file diff --git a/TO REWRITE/Moderation/announcement.js b/TO REWRITE/Moderation/announcement.js index 35508fd4..0b7a3e2d 100644 --- a/TO REWRITE/Moderation/announcement.js +++ b/TO REWRITE/Moderation/announcement.js @@ -31,7 +31,7 @@ class Announcement extends Command { time: 240000 }); - collector.on("collect", async (tmsg) => { + collector.on("collect", async tmsg => { if (tmsg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) { tmsg.delete(); msg.delete(); diff --git a/TO REWRITE/Moderation/poll.js b/TO REWRITE/Moderation/poll.js index 79edc8f2..8b59985b 100644 --- a/TO REWRITE/Moderation/poll.js +++ b/TO REWRITE/Moderation/poll.js @@ -30,7 +30,7 @@ class Poll extends Command { time: 240000 }); - collector.on("collect", async (tmsg) => { + collector.on("collect", async tmsg => { if (tmsg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) { tmsg.delete(); msg.delete(); diff --git a/base/JaBa.js b/base/JaBa.js index a82fc85c..c0d5e62e 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -118,12 +118,27 @@ class JaBa extends Client { }); } + async init() { + this.login(this.config.token); + + mongoose.connect(this.config.mongoDB, { + useNewUrlParser: true, + useUnifiedTopology: true + }).then(() => { + this.logger.log("Connected to the Mongodb database.", "log"); + }).catch((err) => { + this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error"); + }); + + const autoUpdateDocs = require("../helpers/autoUpdateDocs"); + autoUpdateDocs.update(this); + } + /** * * @param {String} dir * @returns */ - async loadCommands(dir) { const filePath = path.join(__dirname, dir); var folders = await fs.readdir(filePath); folders = folders.map(file => path.join(filePath, file)).filter(async (path) => { path = await fs.lstat(path); path.isDirectory(); }); @@ -244,22 +259,6 @@ class JaBa extends Client { } } - async init() { - this.login(this.config.token); - - mongoose.connect(this.config.mongoDB, { - useNewUrlParser: true, - useUnifiedTopology: true - }).then(() => { - this.logger.log("Connected to the Mongodb database.", "log"); - }).catch((err) => { - this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error"); - }); - - const autoUpdateDocs = require("../helpers/autoUpdateDocs"); - autoUpdateDocs.update(this); - } - get defaultLanguage() { return this.languages.find(language => language.default).name; } diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index a996b944..db98900c 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -31,7 +31,7 @@ class Eightball extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { diff --git a/commands/Fun/lmgtfy.js b/commands/Fun/lmgtfy.js index 742ac26b..7a17b6d4 100644 --- a/commands/Fun/lmgtfy.js +++ b/commands/Fun/lmgtfy.js @@ -31,7 +31,7 @@ class LMGTFY extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { diff --git a/commands/Fun/lovecalc.js b/commands/Fun/lovecalc.js index 65d3f626..8de8e276 100644 --- a/commands/Fun/lovecalc.js +++ b/commands/Fun/lovecalc.js @@ -35,7 +35,7 @@ class Lovecalc extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { diff --git a/commands/Fun/memes.js b/commands/Fun/memes.js index ea635ec8..a681313e 100644 --- a/commands/Fun/memes.js +++ b/commands/Fun/memes.js @@ -28,7 +28,7 @@ class Memes extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { @@ -58,7 +58,7 @@ class Memes extends BaseCommand { idle: 60 * 1000 }); - collector.on("collect", async (msg) => { + collector.on("collect", async msg => { const tag = msg?.values[0]; const res = await fetch(`https://meme-api.herokuapp.com/gimme/${tag}`).then(response => response.json()); diff --git a/commands/General/activity.js b/commands/General/activity.js index 2b464478..0570fd6e 100644 --- a/commands/General/activity.js +++ b/commands/General/activity.js @@ -28,7 +28,7 @@ class Activity extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { @@ -64,7 +64,7 @@ class Activity extends BaseCommand { idle: 60 * 1000 }); - collector.on("collect", async (msg) => { + collector.on("collect", async msg => { const activity = msg?.values[0]; const invite = await client.discordTogether.createTogetherCode(voice.id, activity); @@ -78,7 +78,8 @@ class Activity extends BaseCommand { .setTimestamp(); msg.update({ - embeds: [embed] + embeds: [embed], + components: [] }); }); } diff --git a/commands/General/help.js b/commands/General/help.js new file mode 100644 index 00000000..ec4e17be --- /dev/null +++ b/commands/General/help.js @@ -0,0 +1,166 @@ +const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, SelectMenuBuilder, InteractionCollector, PermissionsBitField } = require("discord.js"); +const BaseCommand = require("../../base/BaseCommand"); + +class Help extends BaseCommand { + /** + * + * @param {import("../base/JaBa")} client + */ + constructor(client) { + super({ + command: new SlashCommandBuilder() + .setName("help") + .setDescription(client.translate("general/help:DESCRIPTION")) + .addStringOption(option => + option.setName("command") + .setDescription(client.translate("owner/reload:COMMAND"))), + aliases: [], + dirname: __dirname, + guildOnly: true, + ownerOnly: false + }); + } + /** + * + * @param {import("../../base/JaBa")} client + */ + async onLoad() { + //... + } + /** + * + * @param {import("../../base/JaBa")} client + * @param {import("discord.js").ChatInputCommandInteraction} interaction + * @param {Array} data + */ + async execute(client, interaction) { + const commands = [...new Map(client.commands.map(v => [v.constructor.name, v])).values()]; + const categories = []; + const command = interaction.options.getString("command"); + + if (command) { + const embed = generateCommandHelp(client, interaction, command); + + return interaction.reply({ + embeds: [embed] + }); + } + + commands.forEach(c => { + if (!categories.includes(c.category)) { + if (c.category === "Owner" && interaction.user.id !== client.config.owner.id) return; + categories.push(c.category); + } + }); + + const categoriesRows = categories.sort().map(c => { + return { + label: `${c} (${commands.filter(cmd => cmd.category === c).length})`, + value: c + }; + }); + + const row = new ActionRowBuilder() + .addComponents( + new SelectMenuBuilder() + .setCustomId("help_category_select") + .setPlaceholder(client.translate("common:NOTHING_SELECTED")) + .addOptions(categoriesRows) + ); + + const msg = await interaction.reply({ + content: interaction.translate("common:AVAILABLE_CATEGORIES"), + components: [row], + fetchReply: true + }); + + const collector = new InteractionCollector(client, { + message: msg, + idle: 60 * 1000 + }); + + collector.on("collect", async msg => { + const arg = msg?.values[0]; + + if (categories.find(c => c === arg)) { + const categoryCommands = commands.filter(cmd => cmd.category === arg).map(c => { + return { + label: c.command.name, + value: c.command.name + }; + }); + + const commandsRow = new ActionRowBuilder() + .addComponents( + new SelectMenuBuilder() + .setCustomId("help_commands_select") + .setPlaceholder(client.translate("common:NOTHING_SELECTED")) + .addOptions(categoryCommands) + ); + + await msg.update({ + content: interaction.translate("general/help:COMMANDS_IN", { + category: arg + }), + components: [commandsRow], + fetchReply: true + }); + } else { + const embed = generateCommandHelp(client, interaction, arg); + return msg.update({ + content: null, + components: [], + embeds: [embed] + }); + } + }); + } +} + +function getPermName(bitfield = 0) { + for (const key in PermissionsBitField.Flags) + if (PermissionsBitField.Flags[key] === BigInt(bitfield)) return key; + return null; +} + +function generateCommandHelp(client, interaction, command) { + const cmd = client.commands.get(command); + if (!cmd) return interaction.error("general/help:NOT_FOUND", { search: command }); + + const embed = new EmbedBuilder() + .setAuthor({ + name: interaction.translate("general/help:CMD_TITLE", { + cmd: cmd.command.name + }) + }) + .addFields([ + { + name: interaction.translate("general/help:FIELD_DESCRIPTION"), + value: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:DESCRIPTION`) + }, + { + name: interaction.translate("general/help:FIELD_USAGE"), + value: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`) + }, + { + name: interaction.translate("general/help:FIELD_EXAMPLES"), + value: interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:EXAMPLES`) + }, + { + name: interaction.translate("general/help:FIELD_ALIASES"), + value: cmd.aliases.length > 0 ? cmd.aliases.map(a => `${a}`).join("\n") : interaction.translate("general/help:NO_ALIAS") + }, + { + name: interaction.translate("general/help:FIELD_PERMISSIONS"), + value: cmd.command.default_member_permissions > 0 ? interaction.translate(`misc:PERMISSIONS:${getPermName(cmd.command.default_member_permissions)}`) : interaction.translate("general/help:NO_REQUIRED_PERMISSION") + } + ]) + .setColor(client.config.embed.color) + .setFooter({ + text: client.config.embed.footer + }); + + return embed; +} + +module.exports = Help; \ No newline at end of file diff --git a/commands/General/ping.js b/commands/General/ping.js index 778f16c5..8884393d 100644 --- a/commands/General/ping.js +++ b/commands/General/ping.js @@ -27,7 +27,7 @@ class Ping extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index 475deb5a..da742882 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -32,19 +32,17 @@ class Warn extends BaseCommand { */ async execute(client, interaction, data) { const member = interaction.targetMember; + const memberPosition = member.roles.highest.position; + const moderationPosition = interaction.member.roles.highest.position; if (member.user.bot) return; + if (member.id === interaction.user.id) return interaction.error("moderation/warn:YOURSELF"); + if (interaction.guild.ownerId !== interaction.user.id && !(moderationPosition > memberPosition)) return interaction.error("moderation/ban:SUPERIOR"); const memberData = await client.findOrCreateMember({ id: member.id, guildID: interaction.guildId }); - if (member.id === interaction.user.id) return interaction.error("moderation/warn:YOURSELF"); - - const memberPosition = member.roles.highest.position; - const moderationPosition = interaction.member.roles.highest.position; - if (interaction.guild.ownerId !== interaction.user.id && !(moderationPosition > memberPosition)) return interaction.error("moderation/ban:SUPERIOR"); - const modal = new ModalBuilder() .setCustomId("warn_modal") .setTitle(interaction.translate("moderation/warn:MODAL_TITLE")); diff --git a/commands/NSFW/nsfw.js b/commands/NSFW/nsfw.js index 7fed0963..5a0c0197 100644 --- a/commands/NSFW/nsfw.js +++ b/commands/NSFW/nsfw.js @@ -28,7 +28,7 @@ class NSFW extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { @@ -61,7 +61,7 @@ class NSFW extends BaseCommand { idle: 60 * 1000 }); - collector.on("collect", async (msg) => { + collector.on("collect", async msg => { const tag = msg?.values[0]; const res = await fetch(`https://meme-api.herokuapp.com/gimme/${tag}`).then(response => response.json()); diff --git a/commands/Owner/debug.js b/commands/Owner/debug.js index 4b9ef9e7..21482301 100644 --- a/commands/Owner/debug.js +++ b/commands/Owner/debug.js @@ -73,7 +73,7 @@ class Debug extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction, data) { diff --git a/commands/Owner/eval.js b/commands/Owner/eval.js index d219584b..30e83b0f 100644 --- a/commands/Owner/eval.js +++ b/commands/Owner/eval.js @@ -32,7 +32,7 @@ class Eval extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction, data) { diff --git a/commands/Owner/reload.js b/commands/Owner/reload.js index c04aa4c4..de1fe5e2 100644 --- a/commands/Owner/reload.js +++ b/commands/Owner/reload.js @@ -33,13 +33,13 @@ class Reload extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { const command = interaction.options.getString("command"); const cmd = client.commands.get(command); - if (!cmd) return interaction.error("owner/reload:NOT_FOUND", { search: command }, { ephemeral: true }); + if (!cmd) return interaction.error("general/help:NOT_FOUND", { search: command }, { ephemeral: true }); await client.unloadCommand(`../commands/${cmd.category}`, cmd.command.name); await client.loadCommand(`../commands/${cmd.category}`, cmd.command.name); diff --git a/commands/Owner/say.js b/commands/Owner/say.js index 536e8399..b42a6f52 100644 --- a/commands/Owner/say.js +++ b/commands/Owner/say.js @@ -34,7 +34,7 @@ class Say extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { diff --git a/commands/Owner/servers.js b/commands/Owner/servers.js index 26b52970..4e90f222 100644 --- a/commands/Owner/servers.js +++ b/commands/Owner/servers.js @@ -27,7 +27,7 @@ class Servers extends BaseCommand { /** * * @param {import("../../base/JaBa")} client - * @param {import("discord.js").CommandInteraction} interaction + * @param {import("discord.js").ChatInputCommandInteraction} interaction * @param {Array} data */ async execute(client, interaction) { @@ -72,7 +72,7 @@ class Servers extends BaseCommand { time: 60 * 1000 }); - collector.on("collect", async (reaction) => { + collector.on("collect", async reaction => { if (reaction._emoji.name === "⬅") { i0 = i0 - 10; i1 = i1 - 10; diff --git a/dashboard/utils.js b/dashboard/utils.js index e89d8922..432b5d5f 100644 --- a/dashboard/utils.js +++ b/dashboard/utils.js @@ -11,7 +11,6 @@ async function fetchUser(userData, client, query) { if (userData.guilds) { userData.guilds.forEach((guild) => { if (!client.guilds.cache.get(guild.id)) return; - // eslint-disable-next-line no-undef const perms = new PermissionsBitField(BigInt(guild.permissions)); if (perms.has(PermissionsBitField.Flags.ManageGuild)) guild.admin = true; diff --git a/helpers/autoUpdateDocs.js b/helpers/autoUpdateDocs.js index a350e11d..1e069f78 100644 --- a/helpers/autoUpdateDocs.js +++ b/helpers/autoUpdateDocs.js @@ -18,11 +18,11 @@ module.exports.update = function (client) { // else return 1; // }) - categories.sort().forEach((cat) => { + categories.sort().forEach(cat => { const categoriesArray = [ ["Название", "Описание", "Использование", "Разрешено использование"] ]; - const cmds = [...new Map(commands.filter((cmd) => cmd.category === cat).map(v => [v.constructor.name, v])).values()]; + const cmds = [...new Map(commands.filter(cmd => cmd.category === cat).map(v => [v.constructor.name, v])).values()]; text += `### ${cat} (${cmds.length} ${client.getNoun(cmds.length, "команда", "команды", "команд")})\n\n`; cmds.sort(function (a, b) { diff --git a/languages/ru-RU/general/help.json b/languages/ru-RU/general/help.json index 95e0e0ce..ffd78aa5 100644 --- a/languages/ru-RU/general/help.json +++ b/languages/ru-RU/general/help.json @@ -2,8 +2,8 @@ "DESCRIPTION": "Показать список команд или помощь по данной команде", "USAGE": "help (команда)", "EXAMPLES": "help\nhelp ping", - "CUSTOM": "У добавленных команд нет описания.", - "NOT_FOUND": "Команды `{{search}}` не существует", + "NOT_FOUND": "Команды `{{search}}` не существует.", + "COMMANDS_IN": "Доступные команды в категории `{{category}}`:", "FIELD_USAGE": "Использование", "FIELD_DESCRIPTION": "Описание", "FIELD_ALIASES": "Сокращения", @@ -11,7 +11,6 @@ "NO_ALIAS": "Нет сокращений", "CMD_TITLE": "Помощь по {{cmd}}", "INFO": "● Чтобы получить помощь по определённой команде используйте `help <команда>`!", - "CUSTOM_COMMANDS": "Добавленные команды", "FIELD_PERMISSIONS": "Необходимые права", "NO_REQUIRED_PERMISSION": "Никаких особых прав не нужно для использования данной команды.", "TITLE": "{{name}} | Команды" diff --git a/languages/ru-RU/misc.json b/languages/ru-RU/misc.json index c99c8b93..cc3a54ce 100644 --- a/languages/ru-RU/misc.json +++ b/languages/ru-RU/misc.json @@ -25,6 +25,49 @@ "COOLDOWNED": "Подождите **{{seconds}}**, чтобы снова использовать эту команду!", "CANNOT_DM": "Я не могу отправить вам личное сообщение... Проверьте свои настройки конфиденциальности!", + "PERMISSIONS": { + "CreateInstantInvite": "Создание приглашения", + "KickMembers": "Выгонять участников", + "BanMembers": "Банить участников", + "Administrator": "Администратор", + "ManageChannels": "Управлять каналами", + "ManageGuild": "Управлять сервером", + "AddReactions": "Добавлять реакции", + "ViewAuditLog": "Просматривать журнал аудита", + "PrioritySpeaker": "Приоритетный режим", + "Stream": "Видео", + "ViewChannel": "Просматривать каналы", + "SendMessages": "Отправлять сообщения", + "SendTTSMessages": "Отправка сообщений text-to-speech", + "ManageMessages": "Управлять сообщениями", + "EmbedLinks": "Встраивать ссылки", + "AttachFiles": "Прикреплять файлы", + "ReadMessageHistory": "Читать историю сообщений", + "MentionEveryone": "Упоминание *@*everyone, *@*here и всех ролей", + "UseExternalEmojis": "Использовать внешние эмодзи", + "ViewGuildInsights": "Просматривать статистику сервера", + "Connect": "Подключаться", + "Speak": "Говорить", + "MuteMembers": "Отключать участникам микрофон", + "DeafenMembers": "Отключать участникам звук", + "MoveMembers": "Перемещать участников", + "UseVAD": "Использовать режим активации по голосу", + "ChangeNickname": "Изменить никнейм", + "ManageNicknames": "Управлять никнеймами", + "ManageRoles": "Управлять ролями", + "ManageWebhooks": "Управлять вебхуками (webhooks)", + "ManageEmojisAndStickers": "Управлять эмодзи и стикерами", + "UseApplicationCommands": "Использовать команды приложения", + "ManageEvents": "Управление событиями", + "ManageThreads": "Управление ветками", + "CreatePublicThreads": "Создать публичные ветки", + "CreatePrivateThreads": "Создание приватных веток", + "UseExternalStickers": "Использовать внешние стикеры", + "SendMessagesInThreads": "Отправлять сообщения в ветках", + "UseEmbeddedActivities": "Начать активность", + "ModerateMembers": "Отправить участников подумать о своём поведении" + }, + "NOUNS": { "CREDIT": { "1": "кредит", diff --git a/languages/ru-RU/moderation/warn.json b/languages/ru-RU/moderation/warn.json index b216924d..7436603f 100644 --- a/languages/ru-RU/moderation/warn.json +++ b/languages/ru-RU/moderation/warn.json @@ -1,7 +1,7 @@ { "DESCRIPTION": "Выдать предупреждение пользователю", - "USAGE": "warn [@пользователь] (причина)", - "EXAMPLES": "warn @Jonny_Bro#4226 stupid", + "USAGE": "ПКМ на пользователя - Приложения - warn", + "EXAMPLES": "", "YOURSELF": "Вы не можете подать жалобу на себя!", "MODAL_TITLE": "Выдать предупреждение {{nickname}}", "REASON": "Причина предупреждения", diff --git a/languages/ru-RU/moderation/warns.json b/languages/ru-RU/moderation/warns.json index 1419c7e6..4d7e0c1b 100644 --- a/languages/ru-RU/moderation/warns.json +++ b/languages/ru-RU/moderation/warns.json @@ -1,7 +1,7 @@ { "DESCRIPTION": "Показать список нарушений пользователя!", - "USAGE": "sanctions [@пользователь]", - "EXAMPLES": "sanctions @Jonny_Bro#4226", + "USAGE": "ПКМ на пользователя - Приложения - warns", + "EXAMPLES": "", "SANCTIONS_OF": "Нарушения {{member}}", "NO_SANCTION": "У **{{member}}** нет нарушений." } \ No newline at end of file diff --git a/languages/ru-RU/owner/reload.json b/languages/ru-RU/owner/reload.json index 47d5aba5..b71f43bc 100644 --- a/languages/ru-RU/owner/reload.json +++ b/languages/ru-RU/owner/reload.json @@ -2,6 +2,5 @@ "DESCRIPTION": "Перезагрузить команду!", "COMMAND": "Команда", "EXAMPLES": "reload help", - "NOT_FOUND": "Команды `{{search}}` не существует!", "SUCCESS": "Команда `{{command}}` успешно перезагружена!" } \ No newline at end of file diff --git a/languages/uk-UA/misc.json b/languages/uk-UA/misc.json index d1107569..e4194d45 100644 --- a/languages/uk-UA/misc.json +++ b/languages/uk-UA/misc.json @@ -27,6 +27,51 @@ "COOLDOWNED": "Зачекайте **{{seconds}}**, щоб знову використати цю команду!", "CANNOT_DM": "Я не можу надіслати вам особисте повідомлення... Перевірте налаштування конфіденційності!", + "PERMISSIONS": { + "CREATE_INSTANT_INVITE": "Створення запрошення", + "KICK_MEMBERS": "Виганяти учасників", + "BAN_MEMBERS": "Банити учасників", + "ADMINISTRATOR": "Адміністратор", + "MANAGE_CHANNELS": "Керувати каналами", + "MANAGE_GUILD": "Керувати сервером", + "ADD_REACTIONS": "Додавати реакції", + "VIEW_AUDIT_LOG": "Перегляд журналу аудиту", + "PRIORITY_SPEAKER": "Пріоритетний режим", + "STREAM": "Відео", + "VIEW_CHANNEL": "Перегляд каналів", + "SEND_MESSAGES": "Надсилати повідомлення", + "SEND_TTS_MESSAGES": "Надсилання повідомлень text-to-speech", + "MANAGE_MESSAGES": "Керувати повідомленнями", + "EMBED_LINKS": "Вбудовувати посилання", + "ATTACH_FILES": "Прикріплювати файли", + "READ_MESSAGE_HISTORY": "Читати історію повідомлень", + "MENTION_EVERYONE": "Згадка *@*everyone, *@*here та всіх ролей", + "USE_EXTERNAL_EMOJIS": "Використовувати зовнішні емодзі", + "VIEW_GUILD_INSIGHTS": "Перегляд статистики сервера", + "CONNECT": "Підключатися", + "SPEAK": "Говорити", + "MUTE_MEMBERS": "Вимкнути учасникам мікрофон", + "DEAFEN_MEMBERS": "Вимкнути учасникам звук", + "MOVE_MEMBERS": "Переміщувати учасників", + "USE_VAD": "Використовувати режим активації за голосом", + "CHANGE_NICKNAME": "Змінити нікнейм", + "MANAGE_NICKNAMES": "Керувати нікнеймами", + "MANAGE_ROLES": "Керувати ролями", + "MANAGE_WEBHOOKS": "Керувати вебхуками (webhooks)", + "MANAGE_EMOJIS_AND_STICKERS": "Керувати емодзі та стікерами", + "USE_APPLICATION_COMMANDS": "Використовувати команди програми", + "MANAGE_EVENTS": "Управління подіями", + "MANAGE_THREADS": "Керування гілками", + "USE_PUBLIC_THREADS": "Використовувати публічні гілки", + "CREATE_PUBLIC_THREADS": "Створити публічні гілки", + "USE_PRIVATE_THREADS": "Використання приватних гілок", + "CREATE_PRIVATE_THREADS": "Створення приватних гілок", + "USE_EXTERNAL_STICKERS": "Використовувати зовнішні стікери", + "SEND_MESSAGES_IN_THREADS": "Надсилати повідомлення у гілках", + "START_EMBEDDED_ACTIVITIES": "Почати активність", + "MODERATE_MEMBERS": "Надіслати учасників подумати про свою поведінку" + }, + "NOUNS": { "CREDIT": { "1": "кредит", diff --git a/package.json b/package.json index bb1f5148..591f4e51 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "env": { "commonjs": true, "es6": true, + "es2020": true, "node": true }, "extends": "eslint:recommended",