Compare commits
2 commits
a0dcd68879
...
7abd01a125
Author | SHA1 | Date | |
---|---|---|---|
7abd01a125 | |||
05c1ef07cb |
2 changed files with 13 additions and 6 deletions
|
@ -60,12 +60,20 @@ async function processFile(link) {
|
|||
: "Lines " + startLine + "-" + endLine;
|
||||
|
||||
const targetLines = (
|
||||
entireFile ? lines.slice(0, 30) : lines.slice(startLine - 1, endLine)
|
||||
entireFile
|
||||
? lines.length > 30
|
||||
? lines.slice(0, 30)
|
||||
: lines
|
||||
: lines.slice(startLine - 1, endLine)
|
||||
).join("\n");
|
||||
|
||||
return `**${fileName}: **${whichLines}\n\`\`\`${fileType}\n${unindent(
|
||||
targetLines
|
||||
)}${entireFile ? `\n... (${lines.length - 30} lines left)` : ""}\n\`\`\``;
|
||||
)}${
|
||||
entireFile && lines.length > 30
|
||||
? `\n... (${lines.length - 30} lines left)`
|
||||
: ""
|
||||
}\n\`\`\``;
|
||||
}
|
||||
|
||||
events.add("messageCreate", "codePreviews", async function (msg) {
|
||||
|
|
|
@ -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}`
|
||||
|
|
Loading…
Reference in a new issue