Skip to content

[feat]: add cron builder and daily report generator - #43

Open
not-meet wants to merge 1 commit into
RocketChat:feature/automated-schedule-reportsfrom
not-meet:feat/schedule-cron-report
Open

[feat]: add cron builder and daily report generator#43
not-meet wants to merge 1 commit into
RocketChat:feature/automated-schedule-reportsfrom
not-meet:feat/schedule-cron-report

Conversation

@not-meet

@not-meet not-meet commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds the cron-expression math and the daily report generator for the
scheduled spam-report feature.

changes implemented

  • ScheduledReporter (sendDailyReport)

  • New job (anti-spam-daily-report) that posts a daily digest to a configured admin channel.

  • Pulls flagged-user summaries, admin actions, and current user statuses since the last report (falls back to a 24h lookback if no prior run is recorded).

  • Builds an "all clear" message when there's nothing to report, otherwise renders:

    • Overall totals (flags, flagged users, admin actions, tracked users)
    • Users grouped by spamming level
    • Per-user flag details (trigger breakdown, rooms, current status), capped at 15 with a "+N more" tail
    • Recent admin actions, also capped at 15
  • Sends the message via the app bot user and records the send timestamp (ScheduleStore.markSent) so the next run only covers the new window.

Cron/time utilities

converts an admin's local report time + selected weekdays into a UTC cron string, correctly shifting the day-of-week field when the UTC conversion crosses midnight.

@not-meet
not-meet force-pushed the feat/schedule-cron-report branch from f7d899c to 7a2b738 Compare August 5, 2026 19:29
@not-meet
not-meet force-pushed the feat/schedule-cron-report branch from 7a2b738 to 9c6c65b Compare August 5, 2026 19:34
@not-meet
not-meet marked this pull request as ready for review August 5, 2026 19:35
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.

1 participant