From e3e178d9bd898a55c1736d3098b0a5970c99f113 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Thu, 6 Jan 2022 15:29:31 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=20setafk=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D1=83=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D0=B5=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20afk=20=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/General/setafk.js | 2 +- events/messageCreate.js | 5 +---- languages/ru-RU/general/setafk.json | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/commands/General/setafk.js b/commands/General/setafk.js index c1abfe07..235d3bc1 100644 --- a/commands/General/setafk.js +++ b/commands/General/setafk.js @@ -18,7 +18,7 @@ class Setafk extends Command { async run(message, args, data) { const reason = args.join(" "); - if (!reason) return message.error("general/setafk:MISSING_REASON"); + if (!reason || reason.length > 250) return message.error("general/setafk:MISSING_REASON"); if (reason === "delete") { if (data.userData.afk) { data.userData.afk = null; diff --git a/events/messageCreate.js b/events/messageCreate.js index 97e3e0da..86404d0e 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -104,10 +104,7 @@ module.exports = class { const userData = await client.findOrCreateUser({ id: u.id }); - if (userData.afk) message.error("general/setafk:IS_AFK", { - user: u.tag, - reason: userData.afk - }); + if (userData.afk) message.error("general/setafk:IS_AFK", { user: u.tag, reason: userData.afk }); }); }; diff --git a/languages/ru-RU/general/setafk.json b/languages/ru-RU/general/setafk.json index cf7d0e02..765b3883 100644 --- a/languages/ru-RU/general/setafk.json +++ b/languages/ru-RU/general/setafk.json @@ -1,8 +1,8 @@ { "DESCRIPTION": "Установить AFK статус (пользователь который упомянет вас получит сообщение)", - "USAGE": "{{prefix}}setafk [причина]", + "USAGE": "{{prefix}}setafk [причина/delete]", "EXAMPLES": "{{prefix}}setafk Сру =)", - "MISSING_REASON": "Укажите причину AFK!", + "MISSING_REASON": "Укажите причину AFK! (не больше 250 символов)", "SUCCESS": "Теперь вы AFK по причине: {{reason}}", "DELETED": "**{{username}}**, ваш AFK статус удалён!", "IS_AFK": "**{{user}}** сейчас AFK, причина:\n```{{reason}}```"