mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 00:12:38 +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 events = [];
|
||||||
const standardEvents = await this.fetchHolidays(GOOGLE_CALENDAR_ID);
|
const standardEvents = await this.fetchHolidays(GOOGLE_CALENDAR_ID);
|
||||||
if (standardEvents) events.push(...standardEvents);
|
if (standardEvents) events.push(...standardEvents);
|
||||||
const personalEvents = await this.fetchHolidays(PERSONAL_GOOGLE_CALENDAR_ID);
|
if (PERSONAL_GOOGLE_CALENDAR_ID) {
|
||||||
if (personalEvents) events.push(...personalEvents);
|
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...');
|
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)}.`);
|
return msg.say(`Today's ${events.length === 1 ? 'event is' : `${events.length} events are`}: ${list(events)}.`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "85.9.0",
|
"version": "85.9.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user