Add message if time is below 0 in remind

This commit is contained in:
Dragon Fire
2021-04-10 18:41:20 -04:00
parent 12023a33b4
commit ad5628a6cd
+1
View File
@@ -25,6 +25,7 @@ module.exports = class RemindCommand extends Command {
if (exists) return msg.reply('🕰️ Only one reminder can be set per channel per user.');
const timeMs = time.startDate.getTime() - Date.now();
if (timeMs > 0x7FFFFFFF) return msg.reply('🕰️ Reminders have a maximum length of ~24.84 days.');
if (timeMs < 0) return msg.reply('🕰️ What do you expect me to do, time travel?');
const display = moment().add(timeMs, 'ms').fromNow();
const title = time.eventTitle ? shorten(time.eventTitle, 500) : 'something';
await this.client.timers.setTimer(msg.channel.id, timeMs, msg.author.id, title);