Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/commands/histadd.command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arg? Forgot s?

add(message, args, dry, cmd = command, permissions);
}
else {
Expand Down
7 changes: 6 additions & 1 deletion server/commands/histdel.command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Args here too

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, wrote this out in browser and copy pasted it 😅

del(message, args, dry, cmd = command, permissions);
} else {
message.channel.send("Correct usage: " +
tick(prefix + "histdel index"));
}
return true;
}
return false;
Expand Down
8 changes: 4 additions & 4 deletions server/commands/history.command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was ticking ugly here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed by zand's request, i personally liked it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright I guess, kinda liked it too I think xD

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue is ticking makes it not aligned xD

schedule_starts.push(dateToStringSimple(schedule.setAt).slice(0,10));
adapted.push(schedule.adaptDate ?
dateToStringSimple(schedule.adaptDate).slice(0,10) : "No");
i += 1;
});
}
Expand Down
2 changes: 1 addition & 1 deletion server/commands/napchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down