forked from Galactic/galactic-bot
time limit
This commit is contained in:
parent
1fe036296f
commit
dd1ae50129
@ -4,6 +4,9 @@ Unable to find an avatar with those arguments, try a different size or format.
|
|||||||
[COMMAND_REMIND_CONFIRM]
|
[COMMAND_REMIND_CONFIRM]
|
||||||
Will remind you about '{reminder}' in {time}
|
Will remind you about '{reminder}' in {time}
|
||||||
|
|
||||||
|
[COMMAND_REMIND_INVALID_TIME]
|
||||||
|
Invalid time, cannot be less than 30 seconds.
|
||||||
|
|
||||||
[COMMAND_REMINDERS_TITLE]
|
[COMMAND_REMINDERS_TITLE]
|
||||||
Reminders
|
Reminders
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ class RemindCommand extends SlashCommand {
|
|||||||
const { member, guild, author, channel, subcommand: { name: subcommand } } = invoker;
|
const { member, guild, author, channel, subcommand: { name: subcommand } } = invoker;
|
||||||
|
|
||||||
if (subcommand === 'create') {
|
if (subcommand === 'create') {
|
||||||
|
if(!time.value || time.value < 30) return { index: 'COMMAND_REMIND_INVALID_TIME' };
|
||||||
const text = await guild.filterText(member, reminder.value);
|
const text = await guild.filterText(member, reminder.value);
|
||||||
await guild.createReminder({ time: time.value, reminder: text, user: author, channel });
|
await guild.createReminder({ time: time.value, reminder: text, user: author, channel });
|
||||||
return { index: 'COMMAND_REMIND_CONFIRM', params: { reminder: text, time: Util.humanise(time.value) } };
|
return { index: 'COMMAND_REMIND_CONFIRM', params: { reminder: text, time: Util.humanise(time.value) } };
|
||||||
|
Loading…
Reference in New Issue
Block a user