Skip to content

[Feature] Auto-close lab status at 2am daily #53

Description

@alronova

Summary

The lab status (open / closed) is currently set entirely through chat commands (bot lab is open, bot lab is closed). There's no automatic behavior — if someone forgets to set it to closed at night, it stays stale.

Problem

  • Lab status can remain open long after the lab has closed, giving members incorrect information.
  • Someone has to remember to manually update it every night.

Proposed behavior

  • Use a scheduled task (cron-style) to automatically set the lab status to closed at 2:00 AM IST daily.
  • The bot should send a message to the designated channel when it does so, e.g.:
    🕐 Lab is now closed (auto-updated at 2:00 AM).
    
  • The existing manual commands (bot lab is open, bot lab is closed) continue to work as before and override the auto-status until the next scheduled reset.

Implementation notes

  • The project already depends on node-cron — use it to schedule the task on bot startup.
  • The timezone should be Asia/Kolkata (already set in the Docker environment).
  • The cron expression for 2:00 AM IST daily: 0 2 * * *.

Acceptance criteria

  • Lab status automatically changes to closed at 2:00 AM IST every day.
  • A notification message is posted to the channel when the auto-close happens.
  • Manual bot lab is open after 2:00 AM correctly overrides the status until the next night.
  • Works correctly across timezone/DST boundaries (IST has no DST, so this is straightforward).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions