From 1c188a005fb698c74eed9353b7fd7e057b663428 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sun, 12 Jun 2022 18:12:19 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8,=20=D1=81=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=BA=D1=80=D0=B0=D1=89=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BC=D0=B5=D1=81=D1=82=D0=B0=D0=BC=D0=B8=20=D1=83=20?= =?UTF-8?q?quote=20=D0=B8=20queue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Administration/addcommand.js | 3 +- commands/General/quote.js | 40 +++++++------------ commands/Music/queue.js | 2 +- events/messageCreate.js | 2 +- .../ru-RU/administration/addcommand.json | 4 +- .../ru-RU/administration/delcommand.json | 2 +- languages/ru-RU/general/help.json | 2 +- .../uk-UA/administration/addcommand.json | 2 +- 8 files changed, 23 insertions(+), 34 deletions(-) diff --git a/commands/Administration/addcommand.js b/commands/Administration/addcommand.js index 82b71c06..3a1b2856 100644 --- a/commands/Administration/addcommand.js +++ b/commands/Administration/addcommand.js @@ -33,8 +33,7 @@ class Addcommand extends Command { data.guild.save(); message.success("administration/addcommand:SUCCESS", { - commandName: name, - prefix: data.guild.prefix + commandName: name }); } } diff --git a/commands/General/quote.js b/commands/General/quote.js index 6397153d..f464a03f 100644 --- a/commands/General/quote.js +++ b/commands/General/quote.js @@ -8,7 +8,7 @@ class Quote extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: ["q"], + aliases: ["qu"], memberPermissions: [], botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], nsfw: false, @@ -40,12 +40,8 @@ class Quote extends Command { const msgID = args[0]; if (isNaN(msgID)) { - message.author.send({ - content: message.translate("general/quote:MISSING_ID") - }).then(() => { - message.delete(); - }).catch(() => { - message.error("misc:CANNOT_DM"); + message.error("general/quote:MISSING_ID").then(() => { + if (message.deletable) message.delete(); }); return; } @@ -54,10 +50,8 @@ class Quote extends Command { if (args[1]) { channel = this.client.channels.cache.get(args[1]); if (!channel) { - message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => { - message.delete(); - }).catch(() => { - message.error("misc:CANNOT_DM"); + message.error("general/quote:NO_MESSAGE_ID").then(() => { + if (message.deletable) message.delete(); }); return; } @@ -65,31 +59,27 @@ class Quote extends Command { if (!channel) { message.channel.messages.fetch(msgID).catch(() => { - message.author.send((message.translate("general/quote:NO_MESSAGE_ID"))).then(() => { - message.delete(); - }).catch(() => { - message.error("misc:CANNOT_DM"); + message.error("general/quote:NO_MESSAGE_ID").then(() => { + if (message.deletable) message.delete(); }); return; }).then((msg) => { - message.delete(); + if (message.deletable) message.delete(); message.reply({ embeds: [embed(msg)] }); }); } else { - channel.messages.fetch(msgID).catch(() => { - message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => { - message.delete(); - }).catch(() => { - message.error("misc:CANNOT_DM"); - }); - return; - }).then((msg) => { - message.delete(); + channel.messages.fetch(msgID).then((msg) => { + if (message.deletable) message.delete(); message.reply({ embeds: [embed(msg)] }); + }).catch(() => { + message.error("general/quote:NO_MESSAGE_ID").then(() => { + if (message.deletable) message.delete(); + }); + return; }); } } diff --git a/commands/Music/queue.js b/commands/Music/queue.js index fc6fcc59..972f0768 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -9,7 +9,7 @@ class Queue extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: ["qu"], + aliases: ["q"], memberPermissions: [], botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], nsfw: false, diff --git a/events/messageCreate.js b/events/messageCreate.js index aeb5257b..b8b70859 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -121,7 +121,7 @@ module.exports = class { })); } - if (customCommandAnswer) return message.channel.send({ content: customCommandAnswer }); + if (customCommandAnswer) return message.channel.send({ content: customCommandAnswer.replace("{user}", message.author).replace("{guild}", message.guild) }); if (cmd.conf.guildOnly && !message.guild) return message.error("misc:GUILD_ONLY"); if (message.guild) { diff --git a/languages/ru-RU/administration/addcommand.json b/languages/ru-RU/administration/addcommand.json index 64e97322..d3b3be19 100644 --- a/languages/ru-RU/administration/addcommand.json +++ b/languages/ru-RU/administration/addcommand.json @@ -1,8 +1,8 @@ { "DESCRIPTION": "Создать свою команду!", "USAGE": "{{prefix}}addcommand [название] [ответ]", - "EXAMPLES": "{{prefix}}addcommand hello Привет, {user}!", + "EXAMPLES": "{{prefix}}addcommand hello Привет, {user}. Добро пожаловать на {guild}!", "MISSING_NAME": "Укажите название команды!", "MISSING_ANSWER": "Укажите ответ команды!", - "SUCCESS": "Команда **{{prefix}}{{commandName}}** создана!" + "SUCCESS": "Команда **{{commandName}}** создана!" } \ No newline at end of file diff --git a/languages/ru-RU/administration/delcommand.json b/languages/ru-RU/administration/delcommand.json index ca73e4f9..12e1f9c9 100644 --- a/languages/ru-RU/administration/delcommand.json +++ b/languages/ru-RU/administration/delcommand.json @@ -4,5 +4,5 @@ "EXAMPLES": "{{prefix}}delcommand hello", "MISSING_NAME": "Введите название команды!", "UNKNOWN_COMMAND": "Команда {{commandName}} не существует!", - "SUCCESS": "Команда {{commandName}} была удалена с сервера!" + "SUCCESS": "Команда **{{commandName}}** была удалена с сервера!" } \ No newline at end of file diff --git a/languages/ru-RU/general/help.json b/languages/ru-RU/general/help.json index c8e7f88d..a62ab476 100644 --- a/languages/ru-RU/general/help.json +++ b/languages/ru-RU/general/help.json @@ -11,7 +11,7 @@ "NO_ALIAS": "Нет сокращений", "CMD_TITLE": "Помощь по {{cmd}}", "INFO": "● Чтобы получить помощь по определённой команде используйте `{{prefix}}help <команда>`!", - "CUSTOM_COMMANDS": "Добавленная команда", + "CUSTOM_COMMANDS": "Добавленные команды", "FIELD_PERMISSIONS": "Необходимые права", "NO_REQUIRED_PERMISSION": "Никаких особых прав не нужно для использования данной команды.", "TITLE": "{{name}} | Команды" diff --git a/languages/uk-UA/administration/addcommand.json b/languages/uk-UA/administration/addcommand.json index 66c13f36..8483d9b6 100644 --- a/languages/uk-UA/administration/addcommand.json +++ b/languages/uk-UA/administration/addcommand.json @@ -1,7 +1,7 @@ { "DESCRIPTION": "Створити власну команду!", "USAGE": "{{prefix}}addcommand [назва] [відповідь]", - "EXAMPLES": "{{prefix}}addcommand hello Привіт, {user}!", + "EXAMPLES": "{{prefix}}addcommand hello Привіт, {user}. Добро пожаловать на {guild}!", "MISSING_NAME": "Укажіть назву команди!", "MISSING_ANSWER": "Укажіть відповідь команди!", "SUCCESS": "Команда **{{prefix}}{{commandName}}** створена!"