time limit

This commit is contained in:
Erik 2022-07-12 18:11:08 +03:00
parent 1fe036296f
commit dd1ae50129
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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) } };