privateReminders: should actually work now
This commit is contained in:
parent
a0dcd68879
commit
05c1ef07cb
1 changed files with 3 additions and 4 deletions
|
@ -89,15 +89,14 @@ hf.bot.once("ready", () => {
|
||||||
}
|
}
|
||||||
const channel = dmCache[data.user];
|
const channel = dmCache[data.user];
|
||||||
|
|
||||||
const [date, time] = tzFormatterCache[data.tz]
|
const now = Date.now();
|
||||||
.format(Date.now())
|
const [date, time] = tzFormatterCache[data.tz].format(now).split(", ");
|
||||||
.split(", ");
|
|
||||||
let [hour, minutes] = time.split(":");
|
let [hour, minutes] = time.split(":");
|
||||||
hour = parseInt(hour);
|
hour = parseInt(hour);
|
||||||
minutes = parseInt(minutes);
|
minutes = parseInt(minutes);
|
||||||
const lastRan = new Date(await getLastRun(data.user)).getTime();
|
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(
|
logger.verbose(
|
||||||
"privateReminders",
|
"privateReminders",
|
||||||
`attempting to send reminder to ${data.user}`
|
`attempting to send reminder to ${data.user}`
|
||||||
|
|
Loading…
Reference in a new issue