mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
If no personal calendar is set, skip it
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "85.9.0",
|
||||
"version": "85.9.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user