diff --git a/server/commands/histadd.command.js b/server/commands/histadd.command.js index 811875e..7e10a25 100644 --- a/server/commands/histadd.command.js +++ b/server/commands/histadd.command.js @@ -15,7 +15,7 @@ module.exports = { const permissions = message.member.roles.some((d) => ['Admins', 'Moderator'].includes(d.name) ); - if (args.length == 2) { + if (arg.length == 2 || args.length == 3) { add(message, args, dry, cmd = command, permissions); } else { diff --git a/server/commands/histdel.command.js b/server/commands/histdel.command.js index aa9f28e..e59a6e3 100644 --- a/server/commands/histdel.command.js +++ b/server/commands/histdel.command.js @@ -13,7 +13,12 @@ module.exports = { const permissions = message.member.roles.some((d) => ['Admins', 'Moderator'].includes(d.name) ); - del(message, args, dry, cmd = command, permissions); + if (arg.length == 1 || args.length == 2) { + del(message, args, dry, cmd = command, permissions); + } else { + message.channel.send("Correct usage: " + + tick(prefix + "histdel index")); + } return true; } return false; diff --git a/server/commands/history.command.js b/server/commands/history.command.js index 93a5653..ff5c6e1 100644 --- a/server/commands/history.command.js +++ b/server/commands/history.command.js @@ -65,10 +65,10 @@ async function hist(message, args, cmd) { let i = 0; userDB.historicSchedules.forEach(schedule => { console.log(i); - schedules.push(tick(i) + ' ' + schedule.name); - schedule_starts.push(tick(dateToStringSimple(schedule.setAt).slice(0,10))); - adapted.push(tick(schedule.adaptDate ? - dateToStringSimple(schedule.adaptDate).slice(0,10) : "No")); + schedules.push(i + ' ' + schedule.name); + schedule_starts.push(dateToStringSimple(schedule.setAt).slice(0,10)); + adapted.push(schedule.adaptDate ? + dateToStringSimple(schedule.adaptDate).slice(0,10) : "No"); i += 1; }); } diff --git a/server/commands/napchart.js b/server/commands/napchart.js index f97ac64..a260fd9 100644 --- a/server/commands/napchart.js +++ b/server/commands/napchart.js @@ -32,7 +32,7 @@ async function getNapchart(username, napchartUrl) { const data = await getNapchartPromise(napchartUrl); data.chartData.elements.forEach((element) => { if (element.color === 'red' && element.lane === 0) { - if (element.start >= 24 * 60 || element.end >= 24 * 60) { + if (element.start > 24 * 60 || element.end > 24 * 60) { throw "Invalid napchart."; } if (napchart.sleeps) {