SHARE
TWEET

Untitled

a guest Aug 17th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async run(msg, args) {
  2.     const reminder = args.slice(0, -1).join(" ");
  3.     const when = args[args.length - 1] ? this.client.utils.stringToMillis.isValid(args[args.length - 1]) ? Date.now() + this.client.utils.stringToMillis.convert(args[args.length - 1]).ms : null : null;
  4.  
  5.     if (!reminder || !when) return msg.fail(`You must provided a reminder and also when to remind you!`);
  6.  
  7.     const clientData = this.client.cache;
  8.     if (!clientData.reminders) clientData.reminders = [];
  9.  
  10.     clientData.reminders.push({
  11.       id: msg.author.id,
  12.       reminder,
  13.       when
  14.     });
  15.  
  16.     try {
  17.       await this.client.updateDatabase({ reminders: clientData.reminders });
  18.       return msg.success("I have successfully set a reminder for you!", `**Reminder**: ${reminder}\n\n**When**: ${moment(when).format("dddd, MMMM Do YYYY, hh:mm:ss A")}`);
  19.     } catch (error) {
  20.       return msg.error("set your reminder!", error);
  21.     }
  22.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top