if(isNaN(args[0])){returnmessage.channel.send("You didn't provide a number for how long I should wait to remind you.");}
if(args[0].length>8){returnmessage.channel.send("Whoah there, pal. That's a lot of time! A little too much, perhaps?");}
lettime=Number(args[0]);
if(!args[1]){returnmessage.channel.send("You didn't provide the time format. Must be `<days|hours|minutes>`");}
if(!['days','day','d','hours','hour','h','minutes','minute','m'].includes(args[1].toLowerCase())){returnmessage.channel.send("You didn't provide a proper time format. Must be `days`, `hours`, or `minutes`.");}
if(time>(60*24*14)){returnmessage.channel.send("Reminders are limited to less than 14 days.");}
if(!args[2]){returnmessage.channel.send("You have to tell me what you want me to remind you to do!");}
args.shift();args.shift();
letreminder=args.join(" ");
if(reminder.length>300){returnmessage.channel.send("Your reminder must be less than 300 characters.");}
letstartDate=newDate(Date.now()+(1000*60*time));
newcron.CronJob(startDate,()=>message.author.send(`Here's a reminder you asked me to give you ${moment(newDate(Date.now()-(1000*60*time))).fromNow()}: ${reminder}`).catch(()=>{})).start();
returnmessage.channel.send(`Reminder set! Make sure you have your DMs open, as it will send in DM.`);