Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates scheduled messaging behavior in the bot by moving the existing weekly broadcast to a fixed Sunday time and introducing a new “bi-weekly” message task for a specific (coaches) group, then wiring the new task into the bot startup.
Changes:
- Rescheduled the weekly message cron job to run Sundays at 19:00 (timezone-aware).
- Added a new
coachesMessagecron task intended to send a message every other week to a single configured group. - Updated bot startup to initialize the new task and set the
/addgroupcommand menu.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/tasks/weekly-message.js |
Reschedules the weekly broadcast job to Sundays at 19:00 and reformats the scheduling code. |
src/tasks/biweekly-message.js |
Adds a new bi-weekly/coaches scheduled message task (currently contains multiple runtime-breaking issues). |
src/index.js |
Initializes the new biweekly task and updates bot command menu setup at startup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+26
to
+28
| try{ | ||
| await bot.teleram.sendMessage(coachesGroupId, messageText); | ||
| conseole.log("✅ [Biweekly Message]: Successfully sent!"); |
Comment on lines
+4
to
+10
| const coachesGroupId = process.env.COACHED_GROUP_ID; | ||
|
|
||
| cron.schedule('0 19 * * 0', async () => { | ||
| if(!coachesGroupId){ | ||
| console.error( | ||
| "❌ [Biweekly Message]: No BIWEEKLY_GROUP_ID found in .env file.", | ||
| ); |
| console.log("📅 Bi-weekly message task scheduled successfully."); | ||
| } | ||
|
|
||
| module.export = { coachesMessage }; No newline at end of file |
Comment on lines
+62
to
+64
| ]).then(() => { | ||
| console.log("📋 Command menu updated successfully!"); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.