Skip to content

Commit c0ae284

Browse files
authored
Merge pull request #30 from codex-team/e11sy-patch-1
Update index.js
2 parents 15a4f19 + 712ca5c commit c0ae284

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

config.example.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ notifier_url:
4949
to_do_time: 0 9,18 * * 1-5
5050
pr_time: 0 9,18 * * 1-5
5151
meeting_time: 0 9,18 * * 1-5
52+
meeting_notice_time: 45 8,17 * * 1-5
5253

5354
# List of people (Telegram only) to tag in the «Meeting Message» message
5455
meeting_mention:

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)