Skip to content

Commit b1469ec

Browse files
authored
Update index.js
1 parent 15a4f19 commit b1469ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const PR_TIME = config.pr_time;
4141
* At 21:00 on every day-of-week from Monday through Friday.
4242
*/
4343
const MEETING_TIME = config.meeting_time;
44+
const MEETING_NOTICE_TIME = config.meeting_notice_time;
4445
const octokit = new Octokit({ auth: TOKEN });
4546

4647
const MEMBERS_QUERY = require('./queries/members');
@@ -388,6 +389,24 @@ function parseMeetingMessage(mentionList) {
388389
* Call the Github GraphQL API, parse its response to message and add that message as cron job.
389390
*/
390391
async function main() {
392+
if (MEETING_NOTICE_TIME) {
393+
const meetingNoticeJob = new CronJob(
394+
MEETING_NOTICE_TIME,
395+
() => {
396+
notify(`Meeting will start in 15 minutes🕒`)
397+
.then(() => console.log('MeetingNotice Job Completed'))
398+
.catch(HawkCatcher.send);
399+
},
400+
null,
401+
true,
402+
'Europe/Moskow'
403+
);
404+
405+
meetingNoticeJob.start();
406+
console.log('MeetingNotice notifier started');
407+
console.log('Will notify at:' + MEETING_NOTICE_TIME);
408+
}
409+
391410
if (MEETING_TIME) {
392411
const meetingJob = new CronJob(
393412
MEETING_TIME,

0 commit comments

Comments
 (0)