privateReminders: should actually work now

This commit is contained in:
Cynthia Foxwell 2023-04-03 13:49:03 -06:00
parent a0dcd68879
commit 05c1ef07cb

View file

@ -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}`