Skip to content

Sending coaches form message - #3

Merged
Arrat3 merged 1 commit into
mainfrom
biweekly
Jul 7, 2026
Merged

Sending coaches form message#3
Arrat3 merged 1 commit into
mainfrom
biweekly

Conversation

@Arrat3

@Arrat3 Arrat3 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 7, 2026 20:04
@Arrat3
Arrat3 merged commit 484fcc8 into main Jul 7, 2026
1 check passed
@Arrat3
Arrat3 deleted the biweekly branch July 7, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 coachesMessage cron 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 /addgroup command 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 thread src/index.js
Comment on lines +62 to +64
]).then(() => {
console.log("📋 Command menu updated successfully!");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants