If no personal calendar is set, skip it

This commit is contained in:
Dragon Fire
2018-07-31 13:00:13 -04:00
parent 33fc3ec6b2
commit 8be1e0262c
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -19,8 +19,10 @@ module.exports = class HolidaysCommand extends Command {
const events = [];
const standardEvents = await this.fetchHolidays(GOOGLE_CALENDAR_ID);
if (standardEvents) events.push(...standardEvents);
const personalEvents = await this.fetchHolidays(PERSONAL_GOOGLE_CALENDAR_ID);
if (personalEvents) events.push(...personalEvents);
if (PERSONAL_GOOGLE_CALENDAR_ID) {
const personalEvents = await this.fetchHolidays(PERSONAL_GOOGLE_CALENDAR_ID);
if (personalEvents) events.push(...personalEvents);
}
if (!events.length) return msg.say('There are no events today...');
return msg.say(`Today's ${events.length === 1 ? 'event is' : `${events.length} events are`}: ${list(events)}.`);
} catch (err) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "85.9.0",
"version": "85.9.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {