Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ notifier_url:
to_do_time: 0 9,18 * * 1-5
pr_time: 0 9,18 * * 1-5
meeting_time: 0 9,18 * * 1-5
meeting_notice_time: 45 8,17 * * 1-5

# List of people (Telegram only) to tag in the «Meeting Message» message
meeting_mention:
Expand Down
19 changes: 19 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* At 21:00 on every day-of-week from Monday through Friday.
*/
const MEETING_TIME = config.meeting_time;
const MEETING_NOTICE_TIME = config.meeting_notice_time;
const octokit = new Octokit({ auth: TOKEN });

const MEMBERS_QUERY = require('./queries/members');
Expand Down Expand Up @@ -388,6 +389,24 @@
* Call the Github GraphQL API, parse its response to message and add that message as cron job.
*/
async function main() {
if (MEETING_NOTICE_TIME) {
const meetingNoticeJob = new CronJob(
MEETING_NOTICE_TIME,
() => {
notify(`Meeting will start in 15 minutes🕒`)
Comment thread
e11sy marked this conversation as resolved.
Outdated
.then(() => console.log('MeetingNotice Job Completed'))
.catch(HawkCatcher.send);
},
null,
true,
'Europe/Moskow'
);

meetingNoticeJob.start();
console.log('MeetingNotice notifier started');
console.log('Will notify at:' + MEETING_NOTICE_TIME);
}

Check warning on line 409 in src/index.js

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed
if (MEETING_TIME) {
const meetingJob = new CronJob(
MEETING_TIME,
Expand Down