From b16a6940a8cfdb4b9363504a8c81b67cefd61487 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 30 Sep 2018 18:50:59 +0000 Subject: [PATCH] Improve holidays command --- README.md | 2 +- commands/events/{holidays.js => calendar.js} | 13 +++++++------ package.json | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) rename commands/events/{holidays.js => calendar.js} (77%) diff --git a/README.md b/README.md index 41e12c9e..9833523d 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,10 @@ on the [home server](https://discord.gg/sbMe32W). ### Events: * **astronomy-picture-of-the-day:** Responds with today's Astronomy Picture of the Day. +* **calendar:** Responds with today's holidays. * **days-until:** Responds with how many days there are until a certain date. * **doomsday-clock:** Responds with the current time of the Doomsday Clock. * **google-doodle:** Responds with a Google Doodle, either the latest one or a random one from the past. -* **holidays:** Responds with today's holidays. * **horoscope:** Responds with today's horoscope for a specific Zodiac sign. * **humble-bundle:** Responds with the current Humble Bundle. * **neko-atsume-password:** Responds with today's Neko Atsume password. diff --git a/commands/events/holidays.js b/commands/events/calendar.js similarity index 77% rename from commands/events/holidays.js rename to commands/events/calendar.js index 4231a83d..b289c9e0 100644 --- a/commands/events/holidays.js +++ b/commands/events/calendar.js @@ -3,13 +3,13 @@ const request = require('node-superfetch'); const { list, today, tomorrow } = require('../../util/Util'); const { GOOGLE_KEY, GOOGLE_CALENDAR_ID, PERSONAL_GOOGLE_CALENDAR_ID } = process.env; -module.exports = class HolidaysCommand extends Command { +module.exports = class CalendarCommand extends Command { constructor(client) { super(client, { - name: 'holidays', - aliases: ['google-calendar', 'holiday', 'calendar', 'events'], + name: 'calendar', + aliases: ['google-calendar', 'holiday', 'holidays', 'events'], group: 'events', - memberName: 'holidays', + memberName: 'calendar', description: 'Responds with today\'s holidays.' }); } @@ -23,8 +23,9 @@ module.exports = class HolidaysCommand extends Command { 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)}.`); + if (!events.length) return msg.say('There are no holidays today...'); + const holidays = list(events.map(event => `**${event}**`)); + return msg.say(`Today${events.length === 1 ? ' is' : `'s holidays are`} ${holidays}!`); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/package.json b/package.json index 5c6fc394..e355abdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "91.14.2", + "version": "91.14.3", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {