mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add message if time is below 0 in remind
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user