From dd1ae501299aeaef67872c5f4140e7d3ba6d79b1 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 12 Jul 2022 18:11:08 +0300 Subject: [PATCH] time limit --- src/localization/en_gb/commands/en_gb_utility.lang | 3 +++ src/structure/components/commands/utility/Remind.js | 1 + 2 files changed, 4 insertions(+) diff --git a/src/localization/en_gb/commands/en_gb_utility.lang b/src/localization/en_gb/commands/en_gb_utility.lang index 1e9bf8e..6fae370 100644 --- a/src/localization/en_gb/commands/en_gb_utility.lang +++ b/src/localization/en_gb/commands/en_gb_utility.lang @@ -4,6 +4,9 @@ Unable to find an avatar with those arguments, try a different size or format. [COMMAND_REMIND_CONFIRM] Will remind you about '{reminder}' in {time} +[COMMAND_REMIND_INVALID_TIME] +Invalid time, cannot be less than 30 seconds. + [COMMAND_REMINDERS_TITLE] Reminders diff --git a/src/structure/components/commands/utility/Remind.js b/src/structure/components/commands/utility/Remind.js index 4c1414f..4d098ae 100644 --- a/src/structure/components/commands/utility/Remind.js +++ b/src/structure/components/commands/utility/Remind.js @@ -38,6 +38,7 @@ class RemindCommand extends SlashCommand { const { member, guild, author, channel, subcommand: { name: subcommand } } = invoker; if (subcommand === 'create') { + if(!time.value || time.value < 30) return { index: 'COMMAND_REMIND_INVALID_TIME' }; const text = await guild.filterText(member, reminder.value); await guild.createReminder({ time: time.value, reminder: text, user: author, channel }); return { index: 'COMMAND_REMIND_CONFIRM', params: { reminder: text, time: Util.humanise(time.value) } };