Neko Atsume Password Command

This commit is contained in:
Daniel Odendahl Jr
2018-03-18 14:37:33 +00:00
parent d59c4d44af
commit aabc1cda51
4 changed files with 88 additions and 18 deletions
+3 -17
View File
@@ -1,5 +1,6 @@
const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
const { today, tomorrow } = require('../../util/Util');
const { GOOGLE_KEY, GOOGLE_CALENDAR_ID } = process.env;
module.exports = class HolidaysCommand extends Command {
@@ -21,8 +22,8 @@ module.exports = class HolidaysCommand extends Command {
maxResults: 10,
orderBy: 'startTime',
singleEvents: true,
timeMax: this.tomorrow().toISOString(),
timeMin: this.today().toISOString(),
timeMax: tomorrow().toISOString(),
timeMin: today().toISOString(),
key: GOOGLE_KEY
});
if (!body.items.length) return msg.say('There are no holidays today...');
@@ -31,19 +32,4 @@ module.exports = class HolidaysCommand extends Command {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
today() {
const now = new Date();
now.setHours(0);
now.setMinutes(0);
now.setSeconds(0);
now.setMilliseconds(0);
return now;
}
tomorrow() {
const today = this.today();
today.setDate(today.getDate() + 1);
return today;
}
};