Skip to content

Commit 6c8caaf

Browse files
committed
added date to events hook message
1 parent e36924f commit 6c8caaf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/hooks/calendar.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,17 @@ export async function execute() {
261261
console.log("Checking for events...");
262262
const events = await getValidEvents();
263263

264+
const todayDate = new Date();
265+
const todayDay = todayDate.getDate();
266+
const todayMonth = todayDate.getMonth() + 1;
267+
const todayYear = todayDate.getFullYear();
268+
const todayDateString = todayMonth + "/" + todayDay + "/" + todayYear;
269+
264270
if (events.length === 0) {
265271
return;
266272
} else if (events.length >= 1) {
267273
webhook.send(
268-
`Hey everyone, here are some reminders about our upcoming events! <@&${config.CALENDAR_ROLE_ID}>\n`
274+
`Hey everyone, it's ${todayDateString}, here are some reminders about our upcoming events! <@&${config.CALENDAR_ROLE_ID}>\n`
269275
);
270276
}
271277

0 commit comments

Comments
 (0)