From 05c1ef07cb109670543769114b4676aaf4b4a1c7 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Mon, 3 Apr 2023 13:49:03 -0600 Subject: [PATCH] privateReminders: should actually work now --- src/modules/privateReminders.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/privateReminders.js b/src/modules/privateReminders.js index 5ed6313..5810036 100644 --- a/src/modules/privateReminders.js +++ b/src/modules/privateReminders.js @@ -89,15 +89,14 @@ hf.bot.once("ready", () => { } const channel = dmCache[data.user]; - const [date, time] = tzFormatterCache[data.tz] - .format(Date.now()) - .split(", "); + const now = Date.now(); + const [date, time] = tzFormatterCache[data.tz].format(now).split(", "); let [hour, minutes] = time.split(":"); hour = parseInt(hour); minutes = parseInt(minutes); const lastRan = new Date(await getLastRun(data.user)).getTime(); - if (date > lastRan && hour == data.hour && minutes == 0) { + if (now > lastRan && hour == data.hour && minutes == 0) { logger.verbose( "privateReminders", `attempting to send reminder to ${data.user}`